Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown virtualScroll filter bug #12461

Closed
umuero opened this issue Jan 5, 2023 · 8 comments
Closed

Dropdown virtualScroll filter bug #12461

umuero opened this issue Jan 5, 2023 · 8 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@umuero
Copy link
Contributor

umuero commented Jan 5, 2023

Describe the bug

p-scroller doesn't update the initial scroll after filter changes,
scroll height fixes itself after p-scroller.onScrollChange is called
14.1.1 works correctly, bug is introduced in 14.2.0, still active in 15.0.1

image

https://stackblitz.com/edit/primeng-dropdown-demo-jvprrv

Environment

primeng: 15.0.1
angular 15.0.4

Reproducer

https://stackblitz.com/edit/primeng-dropdown-demo-jvprrv?file=package.json

Angular version

15.0.4

PrimeNG version

15.0.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.12.1

Browser(s)

No response

Steps to reproduce the behavior

  1. Go to https://stackblitz.com/edit/primeng-dropdown-demo-jvprrv?file=package.json
  2. Filter for "8"
  3. The result preview is empty, it corrects itself after scrolling
  4. p-scroller > div > ul has style: "translate3d(0px, 32675px, 0px)", it should be 0,

Expected behavior

No response

@umuero umuero added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 5, 2023
@umuero
Copy link
Contributor Author

umuero commented Jan 5, 2023

for the "Virtual Scroll (10000 Items)" dropdown showcase, set the initial value to 1000,
set [filter]="true", and search for 8;
p-scroller > div > ul should retain the initial scroll value which causes the problem,
we have reproduced with chrome in every OS for primeng >= 14.2.0

@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 5, 2023
@cetincakiroglu cetincakiroglu self-assigned this Jan 5, 2023
@cetincakiroglu cetincakiroglu added this to the 15.0.2 milestone Jan 5, 2023
@cetincakiroglu
Copy link
Contributor

Hi @umuero,

This issue is fixed by b218f47
Closing the issue, thanks for your report and support!

@cetincakiroglu cetincakiroglu removed the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jan 16, 2023
@cetincakiroglu cetincakiroglu removed this from the 15.1.0 milestone Jan 16, 2023
@sak963
Copy link

sak963 commented Jan 19, 2023

Hi @cetincakiroglu
thanks for the help, but it still doesn't work in "primeng": "15.1.0"

image

p-scroller > div > ul has style: "translate3d(0px, 32675px, 0px)", it should be 0,

image

thanks for your support

@cetincakiroglu
Copy link
Contributor

cetincakiroglu commented Jan 19, 2023

Hi,
"itemSize" is a deprecated property, please use "virtualScrollItemSize" instead.

A refactored and working version of your example: https://stackblitz.com/edit/primeng-dropdown-demo-mezh18?file=src%2Fapp%2Fapp.component.html

@sak963
Copy link

sak963 commented Jan 19, 2023

Hi @cetincakiroglu , thanks for the quick response.
apply the change you told me, but it still doesn't work
for the bug to be replicated
[(ngModel)]="item" must have value and the selector appears with an initial load and then you search for the 8

I modified your fork to replicate

https://stackblitz.com/edit/primeng-dropdown-demo-pdztth?file=src%2Fapp%2Fapp.component.html

@cetincakiroglu cetincakiroglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jan 19, 2023
@cetincakiroglu cetincakiroglu added this to the 15.1.1 milestone Jan 19, 2023
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 19, 2023
@mertsincan mertsincan removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 20, 2023
@durmishie
Copy link

durmishie commented Mar 29, 2023

Hello, I'm encountering the same bug in:

  1. Angular: 14.0.1
  2. Primeng: 14.1.2

I know it's fixed in the 15.2.x version of the Primeng, but I cannot update the packages at the moment. Is there "hack" to correct the behaviour of the dropdown, or updating to the latest version of the Primeng is the only solution?

@achrafha
Copy link

achrafha commented Apr 6, 2023

Hello, I'm still having the same issue :

  • Angular : 15.2.5
  • PrimeNg : 15.3.0
    The problem is only present in Firefox.
    The example given by [sak963] still contain the same issue. Can you please reopen this issue ?

@growms
Copy link

growms commented May 27, 2023

@durmishie, @achrafha

I'm blocked in 14 too and the following seems to work :

<p-dropdown
  #myDD
  [virtualScroll]="true"
  [virtualScrollItemSize]="30"
  (onFilter)="onDDFilter(myDD)"
  ...
></p-dropdown>

in the same component :

 onDDFilter(dd:DropDown) {
    if (dd.scroller) {
      dd.scroller.contentEl.style.transform = 'translate3d(0px, 0px, 0px)';
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

7 participants