-
Notifications
You must be signed in to change notification settings - Fork 175
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
Feat/resize columns #350
base: master
Are you sure you want to change the base?
Feat/resize columns #350
Conversation
if it's being resized too much (below it's min width which is 40px)
✅ Deploy Preview for react-datasheet-grid canceled.
|
apparently shifted by 2px resize handles to the right caused horizontal scroll in outerRef to appear
src/style.css
Outdated
|
||
.dsg-resize-handle:hover { | ||
cursor: col-resize; | ||
background: rgba(0, 0, 250, 0.75); |
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.
it should use --dsg-selection-border-color
var instead of hardcoded color
> Type: `({ widths: Array<number | undefined>) => void`<br /> | ||
> Default: `void` | ||
|
||
If provided, the grid will became resizable. This callback is called when the user resizes a column. |
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.
I think we need to have additional boolean flag which enables resizing. One would use resizing without need for handling it.
@@ -277,3 +277,10 @@ Called when the active / highlighted cell changes. Called with null when the gri | |||
> Default: `void` | |||
|
|||
Called when the selection changes. Called with null when the grid is blurred. | |||
|
|||
### onColumnsResize | |||
> Type: `({ widths: Array<number | undefined>) => void`<br /> |
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.
closing }
bracer is missed here
@nick-keller Can this get reviewed and merged please, this has been open for 2 months |
This PR adds possibility to resize columns with with two callbacks: for tracking resize (dragging) and resize end useful for storing which columns were resized. Stored values then can be passed as a property so that after reloading the page the table will restore touched column widths.
What is done:
If you would like to test it out right away, you can try my fork published on npm:
npm i @mir4a/[email protected] --save-exact
.