-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[data grid] Stop event propagation on data grid action buttons (GridActionsCellItem) #19513
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
Conversation
|
@michelengelen 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
|
Deploy preview: https://deploy-preview-19513--material-ui-x.netlify.app/ Bundle size report
|
Co-authored-by: michelengelen <32863416+michelengelen@users.noreply.github.com>
|
This pull request has been inactive for 30 days. Please remove the stale label or leave a comment to keep it open. Otherwise, it will be closed in 15 days. |
|
This pull request has been closed due to 15 days of inactivity after being marked stale. |
…ctionsCellItem) (mui#19513) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: michelengelen <32863416+michelengelen@users.noreply.github.com>
…ctionsCellItem) (mui#19513) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: michelengelen <32863416+michelengelen@users.noreply.github.com>
When data grid rows are wrapped in anchor elements, clicking action buttons would bubble up to the anchor and trigger unintended navigation. This PR adds event propagation prevention to all action button click handlers.
Changes Made
GridActionsCell.tsx
Added
event.stopPropagation()andevent.preventDefault()to thehandleButtonClickfunction to prevent action button clicks from bubbling up to parent elements.GridActionsCellItem.tsx
Added
event.stopPropagation()andevent.preventDefault()to bothhandleClickfunctions:Example Scenario
This ensures that action buttons work independently of any parent clickable elements while maintaining normal row click behavior for non-action areas.
Fixes #19432.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.