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

Invalid class disappears on focus out/blur event for textfield #27

Closed
mormarijn opened this issue Nov 10, 2020 · 5 comments
Closed

Invalid class disappears on focus out/blur event for textfield #27

mormarijn opened this issue Nov 10, 2020 · 5 comments

Comments

@mormarijn
Copy link

mormarijn commented Nov 10, 2020

Hi,

I'm experiencing problems with invalid textfields losing the invalid class on focus out / blur event of input field.
The same behavior can also be seen on the demo page https://material.balmjs.com/#/data-input/textfield below 1.1.
If you select Use Helper Text, Make helper text persistent, and Use helper text as validation message, then at first the invalid class is on the mdc-textfield div: mdc-text-field mdc-text-field--filled mdc-ripple-upgraded mdc-text-field--invalid.
However, when you click outside the textfield, the textfield loses its --invalid class and appears to be normal input again, while it should still be invalid: mdc-text-field mdc-text-field--filled mdc-ripple-upgraded.

If you look at how it should be working according to the specs (https://material.io/components/text-fields/) :
image

and if you then focus out:
image

Am I doing something wrong, or what should I do to enforce the --invalid class to stay on the invalid input?

I am looking forward to hearing from you soon. Thanks in advance.

Kind regards,
Marijn

@elf-mouse
Copy link
Member

Hi @mormarijn ,

This is how the current version behaves, I will consider improving it.

Thanks for you issue.

And welcome to pr :)

@qiuyanghui
Copy link

I am experiencing the same issue, is this issue fixed? if this is fixed , which version has the fix?
Thanks

@qiuyanghui
Copy link

I got this resolved by setting useNativeValidation = false

elf-mouse added a commit that referenced this issue Mar 3, 2022
@elf-mouse
Copy link
Member

elf-mouse commented Mar 3, 2022

Hi @mormarijn @qiuyanghui ,

This bug has been fixed! You can try balm-ui@next(v10.0.3) and enjoy it :)

Thanks again~

@qiuyanghui
Copy link

qiuyanghui commented Mar 3, 2022

Thank you, @elf-mouse @mormarijn

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

No branches or pull requests

3 participants