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(composed-modal): don't close on mouse drag and release outside modal #18188

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

vsvsv
Copy link

@vsvsv vsvsv commented Dec 3, 2024

Closes #18187

Fixed incorrect behavior of ComposedModal closing when user clicks inside modal window, drags cursor outside and releases the mouse button in Chrome.

Changelog

Changed

  • instead of checking only event.target node of 'onClick' event also check event.target of 'onMouseDown' event, and close the modal only if both are not inside the modal window node.

@vsvsv vsvsv requested a review from a team as a code owner December 3, 2024 16:43
Copy link
Contributor

github-actions bot commented Dec 3, 2024

All contributors have signed the DCO.
Posted by the DCO Assistant Lite bot.

@vsvsv
Copy link
Author

vsvsv commented Dec 3, 2024

I have read the DCO document and I hereby sign the DCO.

Copy link

netlify bot commented Dec 3, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 79c081d
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/674f3529014f7300080cb425
😎 Deploy Preview https://deploy-preview-18188--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 3, 2024

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit cafd085
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/676834a5b033910008ca3529
😎 Deploy Preview https://deploy-preview-18188--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 3, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit cafd085
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/676834a56054400008256961
😎 Deploy Preview https://deploy-preview-18188--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 3, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit cafd085
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/676834a5c4ae31000881d860
😎 Deploy Preview https://deploy-preview-18188--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@vsvsv vsvsv force-pushed the 18187-fix-drag-outside-closes-modal branch from 4e841e0 to a96143b Compare December 3, 2024 21:24
Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Thanks for taking a look at this. Looks good to me, but could you add some tests to cover this functionality?

@vsvsv
Copy link
Author

vsvsv commented Dec 22, 2024

@tay1orjones Sure, added unit tests to cover this fix.

@vsvsv vsvsv requested a review from tay1orjones December 22, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants