-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Unable to unset a 'form' prop on a button with null value. #2840
Comments
Do you mean we should remove the check of |
Yep. That would mean Vue will always set it as an attribute, and setting the attribute value as We could in turn add a check for the element's type, as that attribute only exists on form elements. |
The warning is because the form attr is readonly in button https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element , i think this warning message should show to users . Same as #2766 . |
The warning should not show, it should not happen in the first place as we should set the value via |
I see your point, can use |
… (#2849) Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com> Co-authored-by: Thorsten Lünborg <t.luenborg@googlemail.com>
Version
3.0.4
Reproduction link
https://jsfiddle.net/Linusborg/2fwLmu5b/
Steps to reproduce
What is expected?
'form' attribute is being unset successfully.
What is actually happening?
Console Warning:
#1788 attempted to solve a similar problem, making Vue patch this with
setAttribute
instead of setting it as a DOMprop - but the added value check makes Vue fall back to a DOMprop assignment for non-string values.Note also that setting it as an empty string is not a proper solution as this breaks the button's form property's inheritance of the form's ID it might be nested within.
So we need to use
setAttribute()
regardless of the type of value.The text was updated successfully, but these errors were encountered: