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
If an Autocomplete component is using a virtual scroller, the autoHighlight option does not work. The first li item is no longer the overlayRef.current.firstChild.firstChild but the overlayRef.current.firstChild.firstChild.firstChild. Or the overlayRef should be replaced with the virtualScrollerRef. See: autoHighlight.
Also, when navigating through the dropdown with arrow keys, the container fails to scroll when the highlighted item is no longer in view. This issue has the same nature as the previous one, the scrollInView function uses overlayRef instead of virtualScrollerRef. Note that the whole onInputKeyDown function uses overlayRef. See: down arrow and up arrow
melloware
changed the title
Autocomplete: Virtual Scroller incompatible with autoHighlight and scrolling with keys
Autocomplete: Virtual Scroller incompatible with autoHighlight
May 14, 2022
@Syuks I fixed the autohighlight issue but the scrollintoView is a bigger issue because the VirtualScroller has its own scrollIntoView method etc. Its quite complex so do you mind opening another ticket just for the UP and DOWN keys with VirtualScroller? That way I can fix this autoHighlight ticket.
Describe the bug
If an Autocomplete component is using a virtual scroller, the autoHighlight option does not work. The first li item is no longer the
overlayRef.current.firstChild.firstChild
but theoverlayRef.current.firstChild.firstChild.firstChild
. Or theoverlayRef
should be replaced with thevirtualScrollerRef
. See: autoHighlight.Also, when navigating through the dropdown with arrow keys, the container fails to scroll when the highlighted item is no longer in view. This issue has the same nature as the previous one, the
scrollInView
function usesoverlayRef
instead ofvirtualScrollerRef
. Note that the wholeonInputKeyDown
function usesoverlayRef
. See: down arrow and up arrowReproducer
https://codesandbox.io/s/primereact-test-forked-poxorh?file=/src/index.js
PrimeReact version
8.1.0
React version
18.x
Language
ALL
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
Create an Autocomplete component with autoHighlight and virtualScrollerOptions.
Make the dropdown appear.
See no highlight on first item.
Create an Autocomplete component with virtualScrollerOptions.
Make the dropdown appear.
Navigate the dropdown with up and down arrow keys.
See no scrolling of the container.
Expected behavior
I expect the autoHighlight option highlight the first item of an Autocomplete component that is using a virtual scroller container.
I expect the highlighted item to stay in view when navigating with the arrow keys the dropdown of an Autocomplete component using a virtual scroller.
The text was updated successfully, but these errors were encountered: