Open gunarsoskier opened 1 year ago
Yes, there really is such a problem. This works especially badly in conjunction with lazy. Of course, I can make edits myself, but I don't want to override yet another PrimeNg component
Same issue here, is there any plan on the fix for this?
Same problem with v15.4.1, I tried to investigate a little and here is what I found:
In the following method, if this.contentEl
is not currently rendered in the DOM, which is the case after filtering with a text that is NOT in the suggestions, this.contentEl
is truthy and we will not fallback to default styles. In this case, left
, right
, top
and bottom
will be NaN
https://github.com/primefaces/primeng/blob/1b589dbca296d80eb24b0450ccc591746fcb0762/src/app/components/scroller/scroller.ts#L823-L835
This NaN
is propagated from getContentPosition to calculateNumItems then calculateOptions method, where numItemsInViewport
will be NaN
which will result to this.last
being NaN
too.
https://github.com/primefaces/primeng/blob/1b589dbca296d80eb24b0450ccc591746fcb0762/src/app/components/scroller/scroller.ts#L767-L793
Because this.last
is NaN
, the following method responsible for getting all the items to show will return an empty array (this._items.slice(0, NaN)
returns []
). That's why no suggestions are rendered.
https://github.com/primefaces/primeng/blob/1b589dbca296d80eb24b0450ccc591746fcb0762/src/app/components/scroller/scroller.ts#L484-L492
TLDR; root cause seems to be getContentPosition method in scroller component that returns NaN for all directions.
Can you check Primeng 16.3.0. I checked it's already solved.
its not
I tried 16.8.0 and after step 5. it is now showing options but dropdown shrinks to 30px
Describe the bug
Autocomplete stops showing suggestions when virtualScroll is enabled
Environment
https://stackblitz.com/edit/angular-j347mf?file=package.json
Reproducer
No response
Angular version
15.2.5
PrimeNG version
15.3.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
16.19.0
Browser(s)
Chrome 111
Steps to reproduce the behavior
in this demo https://stackblitz.com/edit/angular-j347mf?file=package.json
Expected behavior
suggestions are shown