We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
scrollIntoViewIfNeeded
1 parent 490b4c4 commit d1b4fceCopy full SHA for d1b4fce
1 file changed
source/options.tsx
@@ -210,9 +210,11 @@ function featuresFilterHandler(event: Event): void {
210
}
211
212
213
-function focusFirstField(event: DelegateEvent<Event, HTMLDetailsElement>): void {
214
- if (event.delegateTarget.open) {
215
- const field = select('input, textarea', event.delegateTarget);
+function focusFirstField({delegateTarget: section}: DelegateEvent<Event, HTMLDetailsElement>): void {
+ // @ts-expect-error No Firefox support https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded
+ (section.scrollIntoViewIfNeeded ?? section.scrollIntoView).call(section);
216
+ if (section.open) {
217
+ const field = select('input, textarea', section);
218
if (field) {
219
field.focus();
220
if (field instanceof HTMLTextAreaElement) {
0 commit comments