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

Does text-field support validation? #537

Open
ruichu opened this issue Jan 22, 2024 · 1 comment
Open

Does text-field support validation? #537

ruichu opened this issue Jan 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ruichu
Copy link

ruichu commented Jan 22, 2024

Feature request

I'd like the pattern attribute like HTML input element does. It has a validation pattern so that it can check whether the input value match the pattern such as email, url, number only, etc.

Expected behavior

It it better to check in change event and has a default style when the input value does not match the pattern.
I can do it by myself, but it is a little cumbersome.

Current behavior

I have tried the type attribute. When type="email" or type="tel", I can still input any text into the control.

@ruichu ruichu added the enhancement New feature or request label Jan 22, 2024
@ruichu
Copy link
Author

ruichu commented Feb 3, 2024

I've got it. You can set the attributes for standard <input> or <textarea> to <vscode-text-field> or <vscode-text-area> directly.

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

1 participant