-
Notifications
You must be signed in to change notification settings - Fork 80
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 option to freeze columns to end #3566
Conversation
f697a63
to
1671646
Compare
c76a0f6
to
01bc83a
Compare
If I make last two columns resizable and the last one being frozen-to-end, then I can see two resize handles next to each other. Also, resizing the frozen column looks a bit broken. (first I am resizing through the second to last column's resize handle and then trying to resize from the frozen column) grid-resize-column.mp4 |
3375203
to
dbe14d0
Compare
We can try scrolling the grid horizontally in this case so that resize handle would be always visible. scroll.mp4So it looks like resizing a column past the viewport is not technically supported there. BTW there is no support for columns frozen to the end in Sheets 🙂 |
One thing we can try to do is to show the vertical line when resizing to the right makes the |
I've tried to implement this behavior, here is the result. Would this be good enough in your opinion? scroll-resize.mp4: |
I think it's better this way. |
Added logic and test to implement the behavior described in #3566 (comment) |
Tested it and the visual indicator is indeed better. Found two issue with resizing the column:
grid-scroll-issue.mp4
grid-column-shrink-bug.mp4 |
Confirmed. I could reproduce it without |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Confirmed. This is partially caused by the fact that minimum header cell width is set to web-components/packages/grid/src/vaadin-grid-column-resizing-mixin.js Lines 61 to 62 in e64e89e
But the actual width of the resize handle is at least web-components/packages/grid/src/vaadin-grid-styles.js Lines 220 to 222 in e64e89e
This magic number has been there since the original implementation: vaadin/vaadin-grid@fbed07c I'm not sure if that's a good idea to use such a small "magic number" - it allows you to shrink the column so that it practically disappears. Maybe we could increase this hardcoded value to |
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.
Since we have tickets describing the issues raised on this PR, we can proceed with it and take care of them on separate PRs.
This ticket/PR has been released with Vaadin 23.1.0.alpha1 and is also targeting the upcoming stable 23.1.0 version. |
Description
Fixes #3559
Notable features
The following features are relevant for freezing columns to end:
frozen-to-end
columns can be reordered while remaining frozen to end onlyfrozen-to-end
columns have resize handle on the left (start) to resize easierfrozen-to-end
cell, the grid is scrolled so that normal cell would be fully visible, same as for normalfrozen
columnsfrozen-to-end
columns are positioned using JS, same as normalfrozen
columnsType of change