-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Required fields can not be focusable #733
Comments
Confirm, required inputs become hidden and unfocusable (which leads to submit fail). Also I cannot make the selectized input required. |
Also experiencing this |
Same here. |
Seeing this in Chrome 42 as well. |
Same here on Chrome 43. |
Some sort of workaround... Let style invalid selects with red border .selectize-control.invalid > .selectize-input {
border-color: red;
} And in init of each select add code for checking validation $('select').each(function() {
var $select = $(this).selectize(options);
selectizeValidationFix($select);
});
function selectizeValidationFix($select) {
var self = $select[0].selectize;
self.$input.on('invalid', function (event) {
event.preventDefault();
self.focus(true);
self.$wrapper.addClass('invalid');
});
self.$input.on('change', function (event) {
if (event.target.validity && event.target.validity.valid) {
self.$wrapper.removeClass('invalid');
}
});
} Result: no error message in console about "not focusable" and styling invalid selects with red border. But if on page few selects - all opened together |
Yeah, hopefully this bug is going to fixed soon. I did a quick dirty fix since i also need it. At least it worked for me. Change the code from
to
Use at your own risk. Only tested aganist dropdown style of selectizejs. |
@brianreavis any thoughts on this? |
Same problem, "is not focusable" problem is still here |
selectize.js has known bug with form fields marked as required being ignored. selectize/selectize.js#733 This workaround patches vendor copy in-place per selectize/selectize.js#733 (comment)
any updates on this? |
It's not being actively worked on. A PR with tests is most welcome, and '+1' votes (not comments) help determine what's a priority. |
I can't repro this in Chrome 52 (Mac). Is this still happening? |
This is still an issue. Just tried the |
Getting the error just loading the page? I'm definitely not getting that. It loads without any error. |
I think you need to submit the form. On Fri, Jul 29, 2016 at 2:16 PM Jonathan Allard notifications@github.com
|
We got a winner! STR
Actual: Thrown "An invalid form control with name='' is not focusable." |
A fix is committed, would someone confirm? |
Bug still present on the master branch. Same error, trying to submit an empty form in |
@kmarcisz Are you sure you're running the code in |
@joallard the fix is working on Chrome 52.0.2743.116 m (64-bit) on Windows 10. I've build the master branch and I don't get the error. Thanks for fixing this. |
Error:
An invalid form control with name=''" is not focusable.
File:
/examples/required.html
Browsers:
Chrome v40
andChrome Canary v43
SO:
Windows 7
Ref.: #63 and #136
Seems that the issue is back 😅
The text was updated successfully, but these errors were encountered: