Skip to content

fix(ui): sync SearchBar value with defaultValue changes#65054

Open
Mayankaggarwal8055 wants to merge 5 commits intoapache:mainfrom
Mayankaggarwal8055:fix-searchbar-defaultvalue-sync
Open

fix(ui): sync SearchBar value with defaultValue changes#65054
Mayankaggarwal8055 wants to merge 5 commits intoapache:mainfrom
Mayankaggarwal8055:fix-searchbar-defaultvalue-sync

Conversation

@Mayankaggarwal8055
Copy link
Copy Markdown
Contributor

Fixes #65053

Problem

SearchBar initializes its internal state from defaultValue but does not update when defaultValue changes (e.g., via URL query params or navigation).

This causes the input value to go out of sync with the actual filter state.

Solution

Synchronize internal state with defaultValue using useEffect, ensuring UI reflects current filter state while preserving user input behavior.

Tests

  • Added test to verify syncing when defaultValue changes
  • Added test to ensure user typing is not overridden unnecessarily
  • Existing debounce and clear behavior preserved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SearchBar does not sync with updated defaultValue (URL-driven filters)

1 participant