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

Component: P-dropdown has issue while removing items.Scroll is not happening Properly #17130

Open
acharugulla opened this issue Dec 19, 2024 · 5 comments
Labels
Resolution: Help Wanted Issue or pull request requires extra help and feedback
Milestone

Comments

@acharugulla
Copy link

acharugulla commented Dec 19, 2024

Describe the bug

Primeng dropdown scroll is buggy, when user removes value in editable dropdown. It doesn't scroll to correct value

Environment

Angular

Reproducer

No response

Angular version

17

PrimeNG version

17

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20

Browser(s)

Chrome,Safari , Edge

Steps to reproduce the behavior

Assume you have editable prime ng drop down which has values from 1 to 500. User enters a value in editable dropdown as 300. The dropdown opens and scrolls to 300. But when user erases value (assume 0), then value will be 30, dropdown should scroll to 30
and its not happening

I tried implementing logic like this which is working
https://stackblitz.com/edit/ejxbx3fy?file=src%2Fapp%2Fdropdown-editable-demo.ts,src%2Fapp%2Fdropdown-editable-demo.html
but when i have appendTo Body. it doesn't work

This needs to be fixed

Expected behavior

It should scroll to 30 when user removes 0 in that

@acharugulla acharugulla added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 19, 2024
@acharugulla
Copy link
Author

I tried implementing logic like this which is working
https://stackblitz.com/edit/ejxbx3fy?file=src%2Fapp%2Fdropdown-editable-demo.ts,src%2Fapp%2Fdropdown-editable-demo.html

but when i have appendTo Body. it doesn't work

This needs to be fixed

@mertsincan mertsincan added Resolution: Help Wanted Issue or pull request requires extra help and feedback and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 19, 2024
@mertsincan mertsincan added this to the Future milestone Dec 19, 2024
@github-project-automation github-project-automation bot moved this to Review in PrimeNG Dec 19, 2024
Copy link

Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution! ✨

@qwadrox
Copy link
Contributor

qwadrox commented Dec 20, 2024

@acharugulla
Hi. I tried your example. I type 40000 and then delete a 0 so it becomes 4000 it scrolls there then I remove another 0, and it goes to 400.

Screen.Recording.2024-12-20.at.14.43.28.mov

@acharugulla
Copy link
Author

acharugulla commented Dec 20, 2024

Hi @qwadrox
It is working because i have written the code for scroll

I am calling scroll function each time , based on some conditions. It should work automatically. There are 100's of p-dropdown
I cant keep on adding scroll methods in each p dropdown. I should be provided by framework

You this issue needs to be fixed

@acharugulla
Copy link
Author

I have provided you a solution
You can try with basic example without my code

qwadrox added a commit to qwadrox/primeng that referenced this issue Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Help Wanted Issue or pull request requires extra help and feedback
Projects
Status: Review
Development

No branches or pull requests

3 participants