Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix modal focus #277

Merged
merged 4 commits into from
Jan 8, 2019
Merged

Fix modal focus #277

merged 4 commits into from
Jan 8, 2019

Conversation

jquense
Copy link
Member

@jquense jquense commented Dec 20, 2018

No description provided.

This is an annoying bug that deserves a better solution but i've no time for that :P

What happens is that in the stacked case the lower modal's enforceFocus runs before the new modal is added to the modal stack so the lower one still thinks it's on top.
Copy link
Member

@taion taion left a comment

Choose a reason for hiding this comment

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

so the pattern is something like:

  1. user clicks on a button in modal 1
  2. this button opens modal 2
  3. before modal 2 mounts, the focus callback handler fires and drops the focus in modal 1
  4. autofocus is disabled on modal 2, so nothing moves the focus into modal 2

i don't suppose there's a straightforward way to add a test for this?

@jquense jquense merged commit d348903 into master Jan 8, 2019
@jquense jquense deleted the fix-modal-focus branch January 8, 2019 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants