Skip to content

Clear behavior for search inputs#189

Open
lulkebit wants to merge 1 commit intoNoRiskClient:v3from
lulkebit:feature/clear-behavior-search-inputs
Open

Clear behavior for search inputs#189
lulkebit wants to merge 1 commit intoNoRiskClient:v3from
lulkebit:feature/clear-behavior-search-inputs

Conversation

@lulkebit
Copy link

This pull request improves the user experience and accessibility of the input and search components by adding clear buttons, updating icon usage, and refactoring logic for clarity and maintainability. The main changes include the addition of a clearable button to both the Input and SearchWithFilters components, enhanced accessibility, and code refactoring for better readability.

Input Component Enhancements:

  • Added a computed hasClearableValue variable to determine when to show the clear button, improving logic clarity.
  • Updated the clear button to use the lucide:x icon and added an aria-label for accessibility.

SearchWithFilters Component Improvements:

  • Introduced a clear search button that appears when there is a search value, uses the lucide:x icon, and focuses the input after clearing; also added an aria-label for accessibility.
  • Refactored code to use useRef for input focus control and extracted logic for displaying sort and filter sections into variables for improved readability. [1] [2] [3]

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.

1 participant