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,dialog): prevent unintended close for modals/dialogs when selecting text #569

Closed
wants to merge 1 commit into from

Conversation

tatems
Copy link
Collaborator

@tatems tatems commented Nov 27, 2023

Describe the problem this PR addresses

When clicking and dragging to select text, if the user releases their cursor outside the modal/dialog window, the modal/dialog will close (specifically on Chrome). This is because the click event uses the hovered target on mouseup, which trips the closeOnClickOutside logic. On other browsers like Firefox, the target is the element hovered on mousedown.

Describe the changes in this PR

  • Update @click.capture to @mousedown.capture for the modal/dialog layer components to trigger the closeOnClickOutside logic.

Other information

@tatems tatems requested a review from a team as a code owner November 27, 2023 18:23
@tatems tatems marked this pull request as draft November 27, 2023 18:23
@tatems
Copy link
Collaborator Author

tatems commented Nov 27, 2023

Still need to test on mobile

Copy link

Deployed Styleguide and Lab.

Notes
  1. Links may take a few minutes to update after PR is opened or commit is pushed.
  2. Links may become invalidated after PR is merged or closed.
  3. Links for all releases and open PRs can be found on the Maker Deploys page.

@tatems tatems closed this Jan 29, 2024
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.

1 participant