Skip to content

Conversation

@joaquincasal
Copy link
Collaborator

Purpose

  • Add a 'Clear selection' button to remove current selection of fields
  • Fix a bug in which the search bar would lose focus after the search was triggered

Approach

For the search bar, the bug was happening because it would get disabled after triggering the search, which meant losing the focus on the element. Now we do not disable the search bar, as it is not necessary.

For the clear selection, we added the button and a function to reset related states and components.

Screen.Recording.2025-11-20.at.11.02.21.mov

@joaquincasal joaquincasal requested a review from a team as a code owner November 20, 2025 14:03
Copy link
Contributor

@ryunsong-contentful ryunsong-contentful left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put a comment on line here (line 82) and above the clearSelectionState about this state. It's slightly hacky to force a re-render and there's probably a different way to do this but would probably require a big code re-write which probably isn't worth it for now.

So just leave a comment explaining the main purpose of this state which is to force a re-render

@joaquincasal
Copy link
Collaborator Author

Can you put a comment on line here (line 82) and above the clearSelectionState about this state. It's slightly hacky to force a re-render and there's probably a different way to do this but would probably require a big code re-write which probably isn't worth it for now.

So just leave a comment explaining the main purpose of this state which is to force a re-render

@ryunsong-contentful Done!
Exactly, I agree a refactor would be better but I think it'd be out of scope at the moment.

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.

3 participants