react-data-grid
react-data-grid copied to clipboard
Fix cell focus stealing strategy
NVM we steal focus immediately on mousedown
before we can focus on anything else it seems...
Codecov Report
Merging #2886 (7ae65db) into main (3ead8b4) will increase coverage by
1.09%
. The diff coverage is100.00%
.
:exclamation: Current head 7ae65db differs from pull request most recent head 4a63cb7. Consider uploading reports for the commit 4a63cb7 to get more accurate results
@@ Coverage Diff @@
## main #2886 +/- ##
==========================================
+ Coverage 92.96% 94.06% +1.09%
==========================================
Files 39 38 -1
Lines 1251 1246 -5
Branches 405 397 -8
==========================================
+ Hits 1163 1172 +9
+ Misses 88 74 -14
Impacted Files | Coverage Δ | |
---|---|---|
src/hooks/useRovingCellRef.ts | 100.00% <100.00%> (ø) |
|
src/hooks/useViewportColumns.ts | 83.87% <0.00%> (-1.85%) |
:arrow_down: |
src/hooks/useCalculatedColumns.ts | 99.16% <0.00%> (-0.84%) |
:arrow_down: |
src/utils/selectedCellUtils.ts | 96.92% <0.00%> (-0.18%) |
:arrow_down: |
src/DataGrid.tsx | 90.00% <0.00%> (-0.16%) |
:arrow_down: |
src/Row.tsx | 100.00% <0.00%> (ø) |
|
src/Cell.tsx | 91.30% <0.00%> (ø) |
|
src/Columns.tsx | 100.00% <0.00%> (ø) |
|
src/EditCell.tsx | 100.00% <0.00%> (ø) |
|
src/GroupRow.tsx | 100.00% <0.00%> (ø) |
|
... and 24 more |
Thanks for fixing this!
@nstepien Will this be merged to main do you think? I have used this fix for a while in a project now and it works fine as far as I can see. Would be nice to avoid my forked dependency :)
@gkn it doesn't actually work though from my testing, the grid will steal focus when trying to focus something outside the grid while an editor is open
I use an older fork with this PR https://github.com/gkn/react-data-grid
I need to click twice with the mouse on the input field outside the grid, and it will work. With the unpatched version of the grid, there is no way to keep focus outside the grid. Hope this might lead to a solution for you :)