Skip to content

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

Refocus sql editor after closing destructive query modal (#20759)

Joshen Limf36c1b670697
diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx
index 53b9bfca647..7b4fe14387f 100644
--- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx
+++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx
@@ -568,6 +568,8 @@ const SQLEditor = () => {
buttonLabel="Run destructive query"
onSelectCancel={() => {
setIsConfirmModalOpen(false)
+ // [Joshen] Somehow calling this immediately doesn't work, hence the timeout
+ setTimeout(() => editorRef.current?.focus(), 100)
}}
onSelectConfirm={() => {
setIsConfirmModalOpen(false)