You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When using the cdk listbox on a list that scrolls, the listbox and scroll position behaves weird if that scrollbar is operated with a mouse. The behavior gets worsed if a value is selected.
Operated by mouse means either:
clicking on the little arrows in that scrollbar
clicking on a blank space within that scrollbar
I think there was recently a similar issue in the menu: #30249
The CDK listbox has some logic that forwards focus to the first item when the host is focused.
The problem is that every time the user clicks on the scrollbar, they blur the current item and focus the listbox
which then forwards focus back to the first item which in turn causes the scroll position to jump to the top.
These changes add some logic to not forward focus when focus comes from a mouse interaction.
Fixesangular#30900
took me a while to debug, it's a problem with the focus bouncing back between the listbox and it's children, which caused the selected item to scroll into view
i submitted a PR which stops the event from being forwarded to the children when it comes from a mouse interaction, which is the same way the bug on the cdk/menu was fixed
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When using the cdk listbox on a list that scrolls, the listbox and scroll position behaves weird if that scrollbar is operated with a mouse. The behavior gets worsed if a value is selected.
Operated by mouse means either:
I think there was recently a similar issue in the menu: #30249
Reproduction
StackBlitz link: Also broken in your docs at https://material.angular.io/cdk/listbox/examples
Steps to reproduce:
Listbox with forms validation.
Rat
Expected Behavior
It should just scroll normally.
Actual Behavior
First click scrolls, at second click it jumps back to the top.
Environment
The text was updated successfully, but these errors were encountered: