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 for "required" attributes. #66

Open
QuintinS opened this issue Sep 4, 2023 · 1 comment
Open

Support for "required" attributes. #66

QuintinS opened this issue Sep 4, 2023 · 1 comment

Comments

@QuintinS
Copy link

QuintinS commented Sep 4, 2023

I've implemented this in a project, but when I wanted to add validation to a form field using NiceSelect2, it turned out that the required attribute from the input isn't implemented in a way that makes the input validatable.

The "required" is kept on the original select, which is hidden, which in turn causes the following error when the form is submitted:

An invalid form control with name='customer[note][Veterinarian]' is not focusable.

It would be great if this library implemented this (baseline feature of HTML) in some way!

@Realmaker
Copy link

I have the same issue.

Quick and dirty solution -> use this styles:

select.niceSelect {
display: block !important;
width: 0px !important;
height: 0px !important;
opacity: 0 !important;
}

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

2 participants