quasar
quasar copied to clipboard
QScrollArea: thumb doesn't center on mouse point for small thumbs (long content)
What happened?
When pressing on the bar (not the thumb) of QScrollArea, the content scrolls such that middle of the thumb is positioned underneath the mouse cursor. This behavior is consistent with native scrolling (although inline [non-
] scroll can behave differently).What did you expect to happen?
It works well when there is little content inside scroll area and the thumb size is directly proportional to the size of the content. But when there is a lot of content the snapping breaks.
Reproduction URL
https://codepen.io/thexeos/pen/abrdvVL
How to reproduce?
- Go to reproduction link
- Press on scroll bar area underneath the thumb of the yellow container
- See how the thumb snaps to be centered on mouse pointer
- Now do the same with amber container
- Notice how the further down you click the more off-center the snapping becomes
I'll be submitting a PR shortly.