-
Notifications
You must be signed in to change notification settings - Fork 160
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: add new option defaultCellMinWidth
for columnResizing()
#253
Conversation
I found that the options What do you think of the following options design:
|
defaultCellMinWidth
for columnResizing()
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.
Thanks @YousefED
@@ -50,6 +57,7 @@ export type Dragging = { startX: number; startWidth: number }; | |||
export function columnResizing({ | |||
handleWidth = 5, | |||
cellMinWidth = 25, | |||
defaultCellMinWidth = 100, |
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.
While I agree with the intention behind the PR, I just spent a bunch of time trying to figure out where this 100px min-width was coming from since it was breaking my tests at https://github.com/ueberdosis/tiptap
I think this might actually be considered a breaking change, because now the defaults have changed from being a minimum of 25px to a minimum of 100px. So rendering the same table with the version prior & the new version can render differently
The only path that I see forward here is to change the default of 100
to be 25
or to cellMinWidth
to keep the previous behavior but maintain the new capability (and later on we can introduce change in a major later)
This PR separates
cellMinWidth
intocellMinWidth
anddefaultCellMinWidth
.With this, we can create new columns that are a bit wider (100px default) and have some "breathing space", while still have automatic (not fixed sizing). These columns can still be resized by the user to a width smaller than the initial "auto" width (
defaultCellMinWidth
) up to a minimum ofcellMinWidth
.(Note: I think this is relevant only when your
table
is not set to 100% width)