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

isBooleanAttr for the HTML attribute 'translate' #11391

Closed
EtienneBruines opened this issue May 13, 2020 · 5 comments · Fixed by #11392
Closed

isBooleanAttr for the HTML attribute 'translate' #11391

EtienneBruines opened this issue May 13, 2020 · 5 comments · Fixed by #11392

Comments

@EtienneBruines
Copy link

Version

2.6.11

Reproduction link

https://jsfiddle.net/hgaL8t5n/

Steps to reproduce

Use translate=no in a template

What is expected?

template=no to be rendered in the HTML

What is actually happening?

translate=translate is being rendered instead

You can use devtools to inspect the rendered HTML in the reproducible JSFiddle example.


There is a isBooleanAttr-variable somewhere in the Vue code which marks translate as a boolean, probably to be used like the disabled attribute works.

This is incorrect for two reasons:

  1. "translate" is not a valid value for the attribute (only "", "yes" and "no" are valid). See the spec: https://html.spec.whatwg.org/multipage/dom.html#attr-translate
  2. this translate-attribute is mostly used to indicate not to translate it, so when specifying "no", people actually mean "no"
@posva
Copy link
Member

posva commented May 13, 2020

Maybe we should just remove it from the list. I don't know the reason it was initially added

@nowres
Copy link
Contributor

nowres commented May 13, 2020

Hi @EtienneBruines
Can I take the issue?

@EtienneBruines
Copy link
Author

Yes, please, go ahead.

nowres added a commit to nowres/vue that referenced this issue May 13, 2020
…ctly the key as it's value

when present, translate attribute had translate as it's value, which is not valid, the value should
remain as specified by the user, that's why we removed it form isBooleanAttr map

fix vuejs#11391
@posva posva added the has PR label May 14, 2020
@Jalkse

This comment has been minimized.

@quoctienlam2605

This comment has been minimized.

posva pushed a commit that referenced this issue Sep 21, 2020
when present, translate attribute had translate as it's value, which is not valid, the value should
remain as specified by the user, that's why we removed it form isBooleanAttr map

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

Successfully merging a pull request may close this issue.

5 participants