Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: fix horizontal scroll reset when clicking timestamp cells on the Dashboard (#31624)

hawkcookie50f9ccb5c7f2
diff --git a/apps/studio/components/grid/components/editor/DateTimeEditor.tsx b/apps/studio/components/grid/components/editor/DateTimeEditor.tsx
index d48e4d935b7..1676996991d 100644
--- a/apps/studio/components/grid/components/editor/DateTimeEditor.tsx
+++ b/apps/studio/components/grid/components/editor/DateTimeEditor.tsx
@@ -51,7 +51,11 @@ function BaseEditor<TRow, TSummaryRow = unknown>({
}
useEffect(() => {
- if (ref.current) ref.current.focus()
+ try {
+ ref.current?.focus({ preventScroll: true })
+ } catch (e) {
+ ref.current?.focus()
+ }
}, [])
return (
@@ -69,7 +73,7 @@ function BaseEditor<TRow, TSummaryRow = unknown>({
onEnter={saveChanges}
>
<Input
- autoFocus
+ ref={ref}
value={inputValue ?? ''}
placeholder={FORMAT_MAP[type]}
onChange={(e) => setInputValue(e.target.value)}