Skip to content

Autocomplete: with virtual scroll and item selected, it doesn't show items in dropdown and doesn't keep the selected item position when scrolling #16063

@rbbp23

Description

@rbbp23

Describe the bug

When using Autocomplete with virtual scroll, if we select an item and then scroll down, when we open the dropdown again, everything is blank. If we scroll again we see it scrolls from the beginning and not from the item that was selected.

Environment

Angular 17+
PrimeNG 17.18.5

Reproducer

No response

Angular version

17

PrimeNG version

17.18.5

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.x

Browser(s)

No response

Steps to reproduce the behavior

This can be reproduced on the official documentation:

  1. Go to https://primeng.org/autocomplete#virtualscroll
  2. Open the dropdown, scroll down and select Item 74 (for example)
  3. Open the dropdown again. Blank container is displayed
Screenshot 2024-07-19 at 15 40 25 4. Scroll down, we can see the scroll starts from Item 0 instead of Item 74. 5. Closing and reopening the dropdown will show the same blank container.

Expected behavior

No response

Metadata

Metadata

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions