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

Support number for input types #84

Open
wrangelvid opened this issue Jun 12, 2024 · 2 comments
Open

Support number for input types #84

wrangelvid opened this issue Jun 12, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@wrangelvid
Copy link
Contributor

The input supports text and password as types, and there are many more that exist for the html input. We should consider supporting more of these types and start with a simple one like number.

@bbohlender
Copy link
Contributor

number sounds reasonable, but we should think of a clean line to draw with a clear abstraction that shows what and what is not support for Input since I am very much against support things like a calendar for pmndrs/uikit core.

A possible abstraction could be a filter property which excepts a Regex | (text: string) => boolean. So type="number" implicitly sets the filter property to only filter numbers.

I would not support properties that change the appearance of the Input. This could also mean to rename Input to TextInput and building NumberInput and PasswordInput using TextInput to clarify that Input does not support type="date" etc. What do you think?

@bbohlender bbohlender added the enhancement New feature or request label Jun 12, 2024
@wrangelvid
Copy link
Contributor Author

I agree with you and think the explicit distinction through the name makes sense as long as we keep code reusability high.

TextInput, NumberInput, PasswordInput would be nice. Are there any other inputs you think are must haves?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants