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

"open" seems to be a reserved prop name? #10381

Closed
roed opened this issue Aug 12, 2019 · 5 comments
Closed

"open" seems to be a reserved prop name? #10381

roed opened this issue Aug 12, 2019 · 5 comments

Comments

@roed
Copy link

roed commented Aug 12, 2019

Version

2.6.10

Reproduction link

https://jsfiddle.net/qagby1e4/

Steps to reproduce

Somehow if I use the attribute "open" on a html tag, vue fills the attribute with the value "open". See the attached jfiddle, and inspect the span containing the attribute. If I put the tag outside the vue app, everything is fine. Also, it doesn't matter what the content of the attribute is.

What is expected?

Vue doesn't mutate the attribute "open" on html tags inside the vue app.

What is actually happening?

Vue mutates the "open" attribute with the value "open".


It doesn't seem to be a reserved keyword, although this file https://github.com/vuejs/vue/blob/dev/src/platforms/web/util/attrs.js does specify it as a boolean attribute. In our case, a mathjax html structure, the open attribute can contain string values.

@roed
Copy link
Author

roed commented Aug 12, 2019

Seems someone else is having the same issue, a pr is already opened for this: #10088

@posva
Copy link
Member

posva commented Aug 12, 2019

Duplicate of #10087

@posva posva marked this as a duplicate of #10087 Aug 12, 2019
@posva posva closed this as completed Aug 12, 2019
@Justineo
Copy link
Member

Vue has been treating all attributes as global attributes, which is technically kind of over-simplified. open is a boolean attribute for native <dialog> elements. But changing the current behavior may introduce break changes which we won't accept ATM.

@roed
Copy link
Author

roed commented Aug 13, 2019

Not if it is in a v-pre component. In my opinion Vue should not mutate attributes of 'normal' html tags.

@posva
Copy link
Member

posva commented Aug 13, 2019

Unfortunately we need to mutate them sometimes so it works across browsers. It shouldn't happen with v-pre but that's different and it's already tracked at #10087

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

No branches or pull requests

3 participants