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

[Bug]: ComposedModal closes when user clicks inside modal, drags outside and releases mouse button (Chrome only) #18187

Open
2 tasks done
vsvsv opened this issue Dec 2, 2024 · 0 comments · May be fixed by #18188
Open
2 tasks done

Comments

@vsvsv
Copy link

vsvsv commented Dec 2, 2024

Package

@carbon/react

Browser

Chrome

Package version

v11.71.0

React version

v18.2.0

Description

When using ComposedModal to implement custom modal dialogs, if the user presses left mouse button inside modal window, drags the cursor outside the modal to the background layer, and then releases mouse button, the modal closes.

Reproduction/example

https://stackblitz.com/edit/github-znrzua?file=src%2FApp.jsx

Steps to reproduce

Open a link to Stackblitz example on Google Chrome or a Chrome-like browser; make the preview window wider, so modal is not filling the entire window. Then click inside modal body, and while not releasing the mouse button, drag the cursor away from modal window to background layer, and then release the mouse button. Modal window will close, which is not the expected behavior for the user.

On Firefox, this does not reproduce. The problem may be that on Chrome an event.target element for onClick event is the element that was under the cursor when the mouse button was released, instead of the element, on which the user held the mouse button initially.

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant