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

Fix #14596 - fixes p-dropdown logic for selectedOption and label #14665

Merged

Conversation

rosenthalj
Copy link
Contributor

Fix #14596

  1. fixes logic for the dropdown's selectedOption
  2. uses dropdown's selectedOption for computing label
    -- note: issue with virtual scrolling with lazy loading (PrimeNG Demo) as a result keeping original logic for computing label when virtual load (no harm)

The following video demonstrates the fix working for the reproducer in issue #The following video demonstrates the fix.

BetterDropdownFilterBugFix.mov

fixes logic for selectedOption
1) fixes logic for selectedOption
2) uses selectedOption for computing label
-- note: issue with virtual scrolling with lazy loading (PrimeNG Demo) as a result keeping original logic for computing label when virtual load (no harm)
Copy link

vercel bot commented Jan 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
primeng ⬜️ Ignored (Inspect) Visit Preview Jan 30, 2024 11:59am

@rosenthalj
Copy link
Contributor Author

This pull request also fixes the "second bug" of issue #14367

The first video listed below is running issue #14367's original reproducer(https://stackblitz.com/edit/stackblitz-starters-5fabhi) and "only" demonstrates the second bug defined in issue #14367.

DropdownFilterWithTemplateBug.mov

The second video listed below is with the changes from this pull request and shows bug 2 of issue #14367 has been fixed

DropdownFilterWithTemplateFix.mov

@rosenthalj rosenthalj changed the title Fix #14596 - fixes logic for selectedOption and label Fix #14596 - fixes p-dropdown logic for selectedOption and label Jan 30, 2024
@Draganlazarev90
Copy link

Great to hear that this is fixed, when can we expect this to be merged. Currently it's not included in the 17.5 milestone

@cetincakiroglu cetincakiroglu added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Feb 1, 2024
@cetincakiroglu cetincakiroglu merged commit ca25af1 into primefaces:master Feb 1, 2024
4 checks passed
@cetincakiroglu cetincakiroglu removed the Status: Pending Review Issue or pull request is being reviewed by Core Team label Feb 1, 2024
@imaksp
Copy link

imaksp commented Feb 7, 2024

Hi @cetincakiroglu it seems this has reintroduced this issue (#14241 (comment)) with reactive forms, & it seems it could be fixed by adding virtual scroll to dropdown, for now we have downgraded to 17.4 , in 17.5 form patchValue or setValue is not working as expected for dropdown most likely due to this PR.

@cetincakiroglu
Copy link
Contributor

Hi @imaksp

Thanks for letting me know, I'll check that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

p-dropdown: Filtering all items incorrectly clears the dropdown's selected value
4 participants