Skip to content
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

Document Suggester in Input #4934

Open
willmcgugan opened this issue Aug 26, 2024 · 3 comments
Open

Document Suggester in Input #4934

willmcgugan opened this issue Aug 26, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@willmcgugan
Copy link
Collaborator

The Input widget docs don't cover Suggesters, other than a reference in the API. It is such a useful feature I think it deserves a section with a simple demo.

@carloshm91
Copy link

Yes this is very useful. Also some screenshots with visual examples will be great.

@merriam
Copy link
Contributor

merriam commented Sep 2, 2024

Could I suggest that something more simple and more generic be considered?

A watcher on input should be able to fire on one of two conditions: any change (key press, paste, cut) or any completion (blur or enter). A watcher should be able to be boolean (just disallow the changes) or return a pair with (optional new value, optional new renderable instead of just rendering the value). This allows for suggesters, regex validation, type ahead, complex highlighting like different parts of a url, complex validation like being sure the part number is in stock, and pretty much every use case.

A Suggester just becomes one of the watchers.

@darrenburns darrenburns added the documentation Improvements or additions to documentation label Sep 5, 2024
@darrenburns
Copy link
Member

Could you share a quick code snippet of what that might look like in a new discussion @merriam? I'm struggling to visualize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants
@merriam @willmcgugan @darrenburns @carloshm91 and others