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: popover closing issue when clicked on overflow menu #16792

Merged

Conversation

riddhybansal
Copy link
Contributor

Closes #16357

Popover doesn't close when OverflowMenu is Clicked. The issue is caused after this PR . event.stopPropagation was added to fix calling of handleOnClick twice. The issue doesnot persist now even after removing event.stopPropagation. To ensure the previous issue is not encountered after this PR, test cases has been added.

Changelog

Removed

  • event.stopPropagation() from handleOnClick.

Testing / Reviewing

Go to storybook->popover->test popover should get closed after clicking on overflowMenu or anywhere else.
Test the functioning of overflow menu stories also , it should work as intended and click event should not be called twice.

@riddhybansal riddhybansal requested a review from a team as a code owner June 17, 2024 09:18
Copy link

netlify bot commented Jun 17, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 72c6283
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/667abeb60521710008cb0e8c
😎 Deploy Preview https://deploy-preview-16792--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.

Copy link

netlify bot commented Jun 17, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 72c6283
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/667abeb6b5dd8b0008c1472c
😎 Deploy Preview https://deploy-preview-16792--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.

@tay1orjones tay1orjones added this pull request to the merge queue Jun 26, 2024
Merged via the queue into carbon-design-system:main with commit 697684e Jun 26, 2024
22 checks passed
@yaoterry
Copy link
Contributor

this fix actually broken our application using the OverflowMenu but there is application logic in onClick property for the OverflowMenu, and the onClick callback will also update the other property for the OverflowMenu, then the OverflowMenu open state will be messed up, the menu body can not be opened properly.

Add the event.stopPropagation() back or use a timeout in our onClick logic can work around this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Popover doesn't close when OverflowMenu is Clciked
5 participants