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
fix(cdk/listbox): prevent wrong activeItemIndex after browser tab switch (#27499)
The "activeItemIndex" property of the cdk/listbox component tracks which item in the listbox is currently active or focused. However, some browsers (e.g. Chrome and Firefox) trigger the "focusout" event when the user switches tabs and returns, and set "event.relatedTarget" to null. This causes the "activeItemIndex" to be out of sync with the actual focused element, leading to incorrect behavior and user confusion. To fix this, in `focusout` we store the current active item in `_previousActiveOption` and restore it on the window `blur` event.
0 commit comments