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

Changed the useHotkyes mode to global in the useOverlay to fix event getting trapped when the form input fields were in focus. #2395

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

deepakjosp
Copy link
Contributor

@deepakjosp deepakjosp commented Dec 5, 2024

Fixes #2375

Description

  • The MouseTrap lib by default will not fire callbacks for events inside fields like input, textarea etc.. We have to use bindGlobal if we want the key bindings for work for form fields as well.

By default all keyboard events will not fire if you are inside of a textarea, input, or select to prevent undesirable things from happening.

This means that a keyboard event bound using Mousetrap.bind will only work outside of form input fields, but using Mousetrap.bindGlobal will work in both places.

Documentation - https://craig.is/killing/mice

Checklist

  • I have made corresponding changes to the documentation.
  • I have updated the types definition of modified exports.
  • I have verified the functionality in some of the neeto web-apps.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added proper data-cy and data-testid attributes.
  • I have added the necessary label (patch/minor/major - If package publish
    is required).

Reviewers

…getting trapped when the form input fields were in focus.
@neetodeploy neetodeploy bot temporarily deployed to neeto-ui-1f4k-pr-2395 December 5, 2024 10:35 Inactive
@deepakjosp deepakjosp self-assigned this Dec 5, 2024
@deepakjosp deepakjosp added the patch Releases small requests or bug fixes. label Dec 5, 2024
@deepakjosp
Copy link
Contributor Author

@josephmathew900 _a please review.

@neetogit-bot neetogit-bot bot assigned josephmathew900 and unassigned deepakjosp Dec 5, 2024
Copy link
Contributor

@josephmathew900 josephmathew900 left a comment

Choose a reason for hiding this comment

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

LGTM

@neetodeploy neetodeploy bot temporarily deployed to neeto-ui-1f4k-pr-2395 December 6, 2024 06:11 Inactive
@josephmathew900 josephmathew900 merged commit be0422c into main Dec 6, 2024
1 check was pending
@josephmathew900 josephmathew900 deleted the 2375-issue-with-closeonesc-of-modal branch December 6, 2024 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Releases small requests or bug fixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with closeOnEsc of Modal
2 participants