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]: Overflow Menu in Modal Doesn't Close on Outside Click #17903

Open
2 tasks done
mohakgemini opened this issue Oct 29, 2024 · 2 comments
Open
2 tasks done

[Bug]: Overflow Menu in Modal Doesn't Close on Outside Click #17903

mohakgemini opened this issue Oct 29, 2024 · 2 comments

Comments

@mohakgemini
Copy link

Package

@carbon/react

Browser

No response

Package version

v1.69.0

React version

No response

Description

Current Behavior

  • OverflowMenu stays open when clicking outside the menu but inside the modal
  • The menu can only be closed by:
    • Clicking the overflow menu trigger (⋮) again
    • Selecting a menu item
    • Clicking the ESC key

Expected Behavior

  • OverflowMenu should close when clicking anywhere outside the menu, including the modal content area
  • This should match the behavior of OverflowMenu when used outside of a modal

Reproduction/example

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

Steps to reproduce

Steps to Reproduce

  1. Create a Carbon ComposedModal component
  2. Add an OverflowMenu inside the ModalHeader
  3. Open the modal
  4. Click the overflow menu trigger (⋮) to open the menu
  5. Try to click anywhere else inside the modal

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

@guidari
Copy link
Contributor

guidari commented Oct 29, 2024

This issue is caused by this PR change from onMouseDown to onClick, and the evt.stopPropagation() here is blocking the OverflowMenu to listen for the click.
We should write a test to cover that once we fix it.

@guidari guidari self-assigned this Oct 29, 2024
@guidari
Copy link
Contributor

guidari commented Oct 30, 2024

Hey @davidmenendez is there any specific bug that required the switch between onMouseDown to onClick?
I didn't find any alternative to fix that.

@guidari guidari moved this from ⏱ Backlog to 🏗 In Progress in Design System Oct 31, 2024
@guidari guidari moved this from 🏗 In Progress to ⏱ Backlog in Design System Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ⏱ Backlog
Development

No branches or pull requests

3 participants