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): fix focusing out of modal when elements inside modal are clicked #6960

Closed
wants to merge 4 commits into from

Conversation

driskull
Copy link
Member

@driskull driskull commented May 11, 2023

Related Issue: #6579

Summary

  • Adds optional private property focusTrapContentEl to the FocusTrapComponent which prevents clicked child elements from deactivating the focus trap.
    • If this property isn't defined on the FocusTrapComponent the host element will be used.
  • Anytime an element is clicked, it runs to check if the element is within the focusTrapContentEl and will prevent focus trap from being disabled if true.
  • Adds CSS pointer-events none to content within button for preventing pointer event on it.

@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label May 11, 2023
@driskull driskull closed this May 12, 2023
@driskull driskull deleted the dris0000/focus-trap-deactivate-fix branch May 12, 2023 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant