-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Exclude Disabled Fieldset Descendent Controls #110
Comments
crap, You are right. Missed it. That means iterating over all fields makes it slightly more annoying since we probably have to start looking at the DOM tree :[
That would be nice, just contributing with an idea of how to filter out fields inside a disabled fieldset would be 👍 |
any other suggestions or alternative way? must deal with prefixed versions of matches otherwise |
I stand corrected above; interesting that it triggers What about keeping a reference to the disabled // since this primarily is driven from <= IE 11's lack of support, can't use Array.from without adding a polyfill
const disabledFieldsets = Array.prototype.slice.call(form.querySelectorAll('fieldset:disabled'));
each(form.elements, elm => {
if (!elm.name || elm.disabled || elm.type === 'submit' || elm.type === 'button' || disabledFieldsets.some(f => f.contains(elm)) return
}); |
Are you sure otherwise an alternetive would be elm.matches('fieldset[disabled] *') |
No, you're right; I had spoken too soon (I updated my comment above to reflect). I had figured it wouldn't work based on Agreed--it's a much cleaner implementation! |
fixed, and publish to npm. it's funny how no new features are added or that there is no breaking changes. my patch version is on 20 now :P never had it that high on any application I'm amazed that ppl still are able to find tiny bugs that have gone unnoticed by so many users upon till this day. I would think more ppl would stop using this since most browser have proper support now days |
Cool--thanks for the effort! Unfortunately, IE 11 still has just enough presence that it's too hard to ignore. |
According to the W3C spec, a disabled
<fieldset>
element should cause all descendent form controls, excluding those of the first<legend>
element, to also become disabled.Looking through the source that iterates over the form's elements, I didn't see a check for the above. To have parity with the native implementation of
FormData
, this sounds like a good addition.Happy to help contribute myself if you don't have the bandwidth.
The text was updated successfully, but these errors were encountered: