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

html5 validation not working with required attribute on <select> #449

Closed
maximelebreton opened this issue Oct 17, 2018 · 3 comments
Closed
Labels

Comments

@maximelebreton
Copy link

Hi there!

Sorry, I have no time to make a pull request,
but here is my quick fix to make it works with a native behaviour (not battle tested, but I think it's clean):

.choices[data-type*="select-one"] select.choices__input {
    display: block !important;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    left: 0;
    bottom: 0;
}
@stale
Copy link

stale bot commented Dec 17, 2018

Thanks for contributing to this issue. As it has been 60 days since the last activity, this issue is being automatically closed. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again!

@stale stale bot added the stale label Dec 17, 2018
@stale stale bot closed this as completed Dec 24, 2018
@jeremycook
Copy link

This also worked with https://www.npmjs.com/package/jquery-validation-unobtrusive. If there is any interest in a pull request I would be willing to make one. It's not clear if this is hacky and should be handled by developers using the library on a case-by-case basis (so maybe add a tip to the README.md), or if the CSS should be rolled into Choices.

@redrabbit
Copy link

The solution from @maximelebreton to use opacity: 0 instead ofdisplay: none or visibility: hidden works for me quite well so far. Are there any drawbacks using opacity?

Thanks in advance

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

No branches or pull requests

3 participants