Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Automatically focus first interacive element #10

Merged
merged 3 commits into from
Oct 19, 2022
Merged

Automatically focus first interacive element #10

merged 3 commits into from
Oct 19, 2022

Conversation

nagmat84
Copy link

Fixes the regression noticed by @kamil4 on Gitter at Oct 15th 2022 07:17.

The first interactive element was not automatically focused after opening a dialog. There were two independent issues involved:

  • Previously we only called select for input elements and text areas which selects all existing text, but does not give focus. We must call focus, too. This regression has been introduced by the change from jQuery in favor of native DOM operations. The old select of jQuery always implies an implicit focus.
  • The code was at the wrong position. We can only focus elements after they have become part of the DOM.

Copy link

@kamil4 kamil4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (tested in Lychee).

@nagmat84 nagmat84 merged commit 44bbca9 into master Oct 19, 2022
@nagmat84 nagmat84 deleted the fix-focus branch October 19, 2022 08:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants