-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Overwrite of element attributes with default value #6864
Closed
albrechtjohannes opened this issue
Oct 20, 2017
· 1 comment
· Fixed by annict/annict#1034, annict/annict#1035, owncloud/web#46, OSM-Browser/osm-browser#56 or OSM-Browser/osm-browser#58
Closed
Overwrite of element attributes with default value #6864
albrechtjohannes opened this issue
Oct 20, 2017
· 1 comment
· Fixed by annict/annict#1034, annict/annict#1035, owncloud/web#46, OSM-Browser/osm-browser#56 or OSM-Browser/osm-browser#58
Labels
Comments
albrechtjohannes
changed the title
Do not overwrite element attributes with default value
Overwrite of element attributes with default value
Oct 20, 2017
imyzf
added a commit
to imyzf/vue
that referenced
this issue
Oct 23, 2017
13 tasks
I have fixed this in #6885. |
This was referenced Mar 14, 2018
f2009
pushed a commit
to f2009/vue
that referenced
this issue
Jan 25, 2019
aJean
pushed a commit
to aJean/vue
that referenced
this issue
Aug 19, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What problem does this feature solve?
For custom HTML elements Vue overwrites some attributes with default values. One example is the
selected
attribute which will always be set toselected=selected
for truthy values. This absolutely makes sense for HTML elements that are defined in the HTML standard, but not for custom elements. Custom elements are not yet a web standard but there are already ways to build and use them. We experienced the issue when experimenting with a custom element for a tab bar which has the selected tab stored in a selected attribute.Find a code example in:
https://jsfiddle.net/1pc2e9yj/2/
(The code example is currently limited to Chrome and Safari, because of missing polyfills for other browsers)
What does the proposed API look like?
Vue already has a config setting for
ignoredElements
. My proposal would be, that attributes are not set to their default values for elements in theignoredElements
array. If that approach is valid, then the example code in the jsfiddle would stay the same, but the output would change to "selected attribute value: tab1"The text was updated successfully, but these errors were encountered: