Open
Conversation
|
Deploy preview: https://deploy-preview-21717--material-ui-x.netlify.app/ Updated pages: Bundle size report
|
Contributor
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
mj12albert
reviewed
Mar 23, 2026
| return; | ||
| } | ||
|
|
||
| event.preventDefault(); |
Member
There was a problem hiding this comment.
event.preventDefault()called before empty-selection guard
- In both
handleFillKeyDownandhandleFillRightKeyDown,event.preventDefault()is called immediately after detecting the shortcut, beforegetSelectedCellsAsArray()and theselectedCells.length === 0early return- This suppresses browser defaults (bookmark / reload) even when no cells are selected and no fill occurs
- Fix: Move
event.preventDefault()after the selected-cells check
Repro: when the checkbox cell has focus, I would expect cmd+R to work normally (reload the page)
| }, [apiRef, clearFillPreviewClasses]); | ||
|
|
||
| // Fill handle: mousedown on the fill handle | ||
| const handleFillHandleMouseDown = React.useCallback<GridEventListener<'cellMouseDown'>>( |
Member
There was a problem hiding this comment.
Repro-ed in the deploy preview - have a multi-selection of cells, click the fill handle once, the selection is lost
Clicking fill handle without dragging destroys multi-cell selection
- When a user clicks the fill handle dot and releases without moving (a common accidental interaction):
handleFillHandleMouseDownfires, setsdefaultMuiPrevented = trueon the mousedown event- On mouseup,
applyFill()is a no-op (no targets),cleanupFillDrag()resets state- The browser fires a separate
clickevent —publishEvent('cellClick')resetsdefaultMuiPrevented = falseon this new eventhandleCellClickruns and callssetCellSelectionModel({ [id]: { [field]: true } }), replacing the multi-cell selection with a single cell- Fix: Add a ref like
skipNextClickthat the mousedown handler sets and the click handler checks/clears
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #5380 (Deploy Preview)
Summary
cellSelectionFillHandleprop to DataGridPremium that renders a small drag handle at the bottom-right corner of the cell selection, enabling Excel-like drag-to-fill behavior (vertical and horizontal)box-shadowinstead of standard borders, avoiding layout shiftChanges
New feature: Fill handle (
cellSelectionFillHandleprop)processRowUpdateand the existingCellValueUpdaterfrom the clipboard importNew keyboard shortcuts
Inspired by Excel, these shortcuts, although conflicting with some other shortcuts, make sense in the context.
New CSS classes
cell--withFillHandle— cell displaying the fill handle dotcell--fillPreview,cell--fillPreviewTop/Bottom/Left/Right— dashed border preview during drag