Skip to content

[POC] Add filtering capabilities to SelectNext #1294

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

Closed
wants to merge 1 commit into from

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Oct 9, 2023

Part of #1254

This PR adds a new SelectNext.Filterable component, designed to wrap SelectNext.Options objects, and allow them to be filtered via text query.

Grabacion.de.pantalla.desde.2023-10-09.11-18-50.webm

Usage

Proposal was described in Part of #1254

TODO

  • Currently changing the input content triggers a re-render, which makes every option call shouldRender as expected.
    However, this is not very obvious. There should be a more direct way to call shouldRender instead of relying on it being called as a side effect.
  • Since Options are responsible for their own rendering, there's no easy way to tell if none are being rendered in order to display a "No results" placeholder.
  • It might make sense to debounce the invokation to onFilter
  • The original design includes a magnifying glass icon in the search box. We don't have one yet.
  • We might want to customize the native "clear" button for input[type="search"]. Maybe using a text input with a custom clear button would be an option.

Testing steps

This can be tested in http://localhost:4001/input-select-next, with the Select with filtering example.

@acelaya acelaya marked this pull request as draft October 9, 2023 09:27
@acelaya acelaya force-pushed the select-next-filtering branch from 39115af to a8fc554 Compare October 10, 2023 13:26
@acelaya
Copy link
Contributor Author

acelaya commented Oct 19, 2023

Closing this for now. It can serve as an example if we decide to come back to it at some point.

@acelaya acelaya closed this Oct 19, 2023
@acelaya acelaya deleted the select-next-filtering branch March 31, 2025 12:57
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