Skip to content

Listbox inside a combobox not scrolling on keyboard navigation #2447

Answered by LFDanLu
paustint asked this question in Q&A
Discussion options

You must be logged in to vote

Strange, focused elements should've been brought into view via

// If not virtualized, scroll the focused element into view when the focusedKey changes.
// When virtualized, Virtualizer handles this internally.
useEffect(() => {
if (!isVirtualized && manager.focusedKey && scrollRef?.current) {
let element = scrollRef.current.querySelector(`[data-key="${manager.focusedKey}"]`) as HTMLElement;
if (element) {
scrollIntoView(scrollRef.current, element);
}
}
}, [isVirtualized, scrollRef, manager.focusedKey]);
, I'll dive into your…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@LFDanLu
Comment options

LFDanLu Oct 14, 2021
Collaborator

@paustint
Comment options

Answer selected by paustint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants