From 71c092be1ed9a7314cb5d319f875f2e44fff3110 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 25 Aug 2023 09:49:04 +0100 Subject: [PATCH] Stop focusing submit button in modals as this causes long modals to scroll to the bottom --- packages/bbui/src/Modal/Modal.svelte | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/bbui/src/Modal/Modal.svelte b/packages/bbui/src/Modal/Modal.svelte index 384cfe6cac..36d2e4cf0e 100644 --- a/packages/bbui/src/Modal/Modal.svelte +++ b/packages/bbui/src/Modal/Modal.svelte @@ -60,14 +60,6 @@ if (inputs?.length) { inputs[0].focus() } - - // Otherwise try to focus confirmation button - else if (modal) { - const confirm = modal.querySelector(".confirm-wrap .spectrum-Button") - if (confirm) { - confirm.focus() - } - } } setContext(Context.Modal, { show, hide, toggle, cancel })