Skip to content

fix: #8510 persistent label for dynamic options in Dropdown#8522

Open
baitul1900 wants to merge 1 commit intoprimefaces:masterfrom
baitul1900:fix-dropdown-label-issue-8510
Open

fix: #8510 persistent label for dynamic options in Dropdown#8522
baitul1900 wants to merge 1 commit intoprimefaces:masterfrom
baitul1900:fix-dropdown-label-issue-8510

Conversation

@baitul1900
Copy link
Copy Markdown

This PR addresses issue #8510 where the Dropdown component displays a blank label if the currently selected value is missing from the options list (common during remote or manual filtering).

Key Changes:

  1. Added a lastSelectedOption ref to cache the most recent valid option object.
  2. Updated getSelectedOption to return the cached object if the current props.value matches it, even when not present in the current props.options.

This ensures the UI remains consistent during dynamic data updates.

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.

2 participants