Resize column via keyboard#3754
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3754 +/- ##
=======================================
Coverage 98.80% 98.80%
=======================================
Files 47 47
Lines 3424 3444 +20
Branches 743 749 +6
=======================================
+ Hits 3383 3403 +20
Misses 41 41
🚀 New features to boost your workflow:
|
This reverts commit 5d664f4.
| } else if ( | ||
| resizable && | ||
| isCtrlKeyHeldDown(event) && | ||
| (key === 'ArrowLeft' || key === 'ArrowRight') |
There was a problem hiding this comment.
Open to suggestion on which shortcut to use. I did not find any good example other than this. But the example uses a different strategy where the resizer gets focused. I think we can keep our implementation simple
| // TODO: check if we can use `preventDefault` instead | ||
| event.stopPropagation(); | ||
| const { width } = event.currentTarget.getBoundingClientRect(); | ||
| const offset = key === 'ArrowLeft' ? -10 : 10; |
There was a problem hiding this comment.
We can also add support to resize to max-content. Maybe ctrl + m?
| (key === 'ArrowLeft' || key === 'ArrowRight') | ||
| ) { | ||
| // prevent navigation | ||
| // TODO: check if we can use `preventDefault` instead |
There was a problem hiding this comment.
I think it would be better to use preventDefault and handleCellKeyDown can ignore the event if it is prevented. I remember there was issue with editor though. I will check in a separate PR
Fixes #3320
Resize column on
Ctrl + ArrowRight/Left.