-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Describe the bug
I've encountered some issues with the AutoComplete component while virtualscrolling.
When there is an itemTemplate, optionGroupLabel and optionGroupChildren. The virtualscrolling doesn't work. While scrolling the dropdown will flicker and be reset to the very top.
During logging I found out, that all suggestions are passed to the itemTemplate function. When not using itemTemplate, optionGroupLabel and optionGroupChildren you can see that only like 12 suggestions are being passed. Also while scrolling when you log the parameter of onLazyLoad you can see that first is almost always 0 and last doesn't get higher than 1. When not using itemTemplate, optionGroupLabel and optionGroupChildren, first and last are updated normally.
I've added a codesandbox to reproduce this issue, to check the "normal" behaviour just comment the first return statement which is an array and use the second return which just uses suggestions.
I hope my description is sufficient.
Reproducer
https://codesandbox.io/s/blissful-smoke-9bjjm9?file=/src/demo/AutoCompleteDemo.js:1994-2013
PrimeReact version
8.6.1
React version
17.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
Chrome
Steps to reproduce the behavior
No response
Expected behavior
No response