web-components
web-components copied to clipboard
[vaadin-scroller] Add streaming / stricky scroll theme variant.
Describe your motivation
Current behavior of the vaadin-scroll when implementing e.g. chat, is not optimal, see:
https://vaadin.com/forum/t/sticky-scroll-doesnt-work/178579
Describe the solution you'd like
You can enable sticky scroll with the following CSS additions to styles.css:
vaadin-scroller {
flex: 1;
scroll-snap-type: y proximity;
}
vaadin-scroller::after {
display: block;
content: '';
scroll-snap-align: end;
min-height: 1px;
}
To make UX even nicer, you could add streaming class name to the chat while it’s streaming new tokens and prefix the selectors with .streaming vaadin-scroller so it would only auto-scroll while streaming.
Describe alternatives you've considered
No response
Additional context
No response
I think this should just be a property instead of a theme variant
I think this should just be a property instead of a theme variant
Yes, that would work too.