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

[message-list] Replace hardcoded 50px value used for detecting need to scroll

Open web-padawan opened this issue 5 months ago • 0 comments

Motivation

When adding a new item to message-list, there is a JS logic that checks if there is >50px to bottom:

https://github.com/vaadin/web-components/blob/8068d7d35ec0ffe26582a83630c3ad5b27b90233/packages/message-list/src/vaadin-message-list-mixin.js#L98

There is also a test that expects no scroll when a the top which failed with base styles, see https://github.com/vaadin/web-components/pull/9533.

The problem is that vaadin-message height can be in theory smaller than 50px by default - then it would break.

Proposed solution

Improve logic to calculate the default height of a single message rather than using a hardcoded value.

web-padawan avatar Jun 24 '25 13:06 web-padawan