When the list is scaled by transform: scale() the size of the list has wrong sizes in order to scroll to specific index. Comparing to scaled list with font-size: clamp(), in this way it works properly with no issues and can be scrolled to specific index.
To Reproduce
Steps to reproduce the behavior:
1) Initially you will see font-size: clamp implementation, try Scroll To 1000, you will be able to scroll to the last element.
When the list is scaled by
transform: scale()
the size of the list has wrong sizes in order to scroll to specific index. Comparing to scaled list withfont-size: clamp()
, in this way it works properly with no issues and can be scrolled to specific index.Reproduction codesandbox
To Reproduce Steps to reproduce the behavior: 1) Initially you will see
font-size: clamp
implementation, tryScroll To 1000
, you will be able to scroll to the last element.2) In order to switch to
transform: scale
implementation, commentfontSize: "1.27em"
in line 84 and uncomment next 2 lines with:then
Scroll To 1000
, you will see that it wasn't scrolled to the last one.Expected behavior Scroll to index will work even on scaled (by
transform: scale()
) list.Screenshots 1) scroll to 1000 with
clamp
:2) scroll to 1000 with 'scale':