We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26e38a5 commit 5a14915Copy full SHA for 5a14915
src/lib/components/common/Modal.svelte
@@ -20,6 +20,13 @@
20
hideErrorAlert();
21
onOpen();
22
});
23
+ modal.addEventListener('shown.bs.modal', () => {
24
+ // Automatically set focus on first input element (if any)
25
+ const firstInput = document.querySelector(`#${id} input`);
26
+ if (firstInput instanceof HTMLElement) {
27
+ firstInput.focus();
28
+ }
29
+ });
30
modal.addEventListener('hidden.bs.modal', onClose);
31
}
32
0 commit comments