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 · 1 comment · May be fixed by #18188
Open
2 tasks done
Labels
needs: community contribution Due to roadmap and resource availability, we are looking for outside contributions on this issue. severity: 3 https://ibm.biz/carbon-severity type: bug 🐛

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

@sstrubberg sstrubberg moved this to 🕵️‍♀️ Triage in Design System Dec 10, 2024
@tay1orjones tay1orjones added severity: 3 https://ibm.biz/carbon-severity needs: community contribution Due to roadmap and resource availability, we are looking for outside contributions on this issue. and removed status: needs triage 🕵️‍♀️ labels Dec 10, 2024
@tay1orjones tay1orjones moved this from 🕵️‍♀️ Triage to ⏱ Backlog in Design System Dec 10, 2024
@tay1orjones tay1orjones moved this from ⏱ Backlog to 🏗 In Progress in Design System Dec 10, 2024
@tay1orjones tay1orjones moved this from 🏗 In Progress to 🚦 In Review in Design System Dec 10, 2024
@Nezure
Copy link

Nezure commented Dec 12, 2024

The "regular" Modal component has the same behaviour
https://stackblitz.com/edit/github-znrzua-pzrkratz?file=src%2FApp.jsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: community contribution Due to roadmap and resource availability, we are looking for outside contributions on this issue. severity: 3 https://ibm.biz/carbon-severity type: bug 🐛
Projects
Status: 🚦 In Review
Development

Successfully merging a pull request may close this issue.

3 participants