web-components icon indicating copy to clipboard operation
web-components copied to clipboard

[vaadin-scroller] Add streaming / stricky scroll theme variant.

Open TatuLund opened this issue 3 months ago • 2 comments

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

TatuLund avatar Sep 29 '25 10:09 TatuLund

I think this should just be a property instead of a theme variant

tomivirkki avatar Sep 29 '25 10:09 tomivirkki

I think this should just be a property instead of a theme variant

Yes, that would work too.

TatuLund avatar Sep 29 '25 11:09 TatuLund