-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Reimplement drag fill #3766
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
base: main
Are you sure you want to change the base?
Reimplement drag fill #3766
Conversation
@@ -391,7 +392,6 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr | |||
/** | |||
* refs | |||
*/ | |||
const latestDraggedOverRowIdx = useRef(draggedOverRowIdx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer needed as we are using react event handlers
const offset = | ||
scrollTop - | ||
headerAndTopSummaryRowsHeight + | ||
event.clientY - | ||
gridEl.getBoundingClientRect().top; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way?
@@ -1056,7 +1124,6 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr | |||
gridRowStart, | |||
selectedCellIdx: selectedRowIdx === rowIdx ? selectedIdx : undefined, | |||
draggedOverCellIdx: getDraggedOverCellIdx(rowIdx), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably add another div and get rid of draggedOverCellIdx
package.json
Outdated
@@ -68,8 +68,8 @@ | |||
"@typescript-eslint/eslint-plugin": "^8.29.0", | |||
"@typescript-eslint/parser": "^8.29.0", | |||
"@vitejs/plugin-react": "^4.3.4", | |||
"@vitest/browser": "^3.1.1", | |||
"@vitest/coverage-v8": "^3.1.1", | |||
"@vitest/browser": "3.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resizable tests fail in the latest version
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3766 +/- ##
==========================================
- Coverage 98.82% 98.78% -0.05%
==========================================
Files 47 46 -1
Lines 3499 3466 -33
Branches 766 763 -3
==========================================
- Hits 3458 3424 -34
- Misses 41 42 +1
🚀 New features to boost your workflow:
|
Fixes #3215
This PR fixes a few issues with drag fill
mouseenter
event to find the dragged over row which does not work if the pointer is outside the grid. The new logic uses mouse coordinates andfindRowIdx
.scrollIntoView
to fix itFF has a bug which results in cell selection change on drag
https://bugzilla.mozilla.org/show_bug.cgi?id=1961462