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

Open
EtienneBruines opened this issue May 13, 2020 · 3 comments · May be fixed by #11392
Open

isBooleanAttr for the HTML attribute 'translate' #11391

EtienneBruines opened this issue May 13, 2020 · 3 comments · May be fixed by #11392

Comments

@EtienneBruines
Copy link

@EtienneBruines EtienneBruines commented May 13, 2020

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 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

@nowres nowres commented May 13, 2020

Hi @EtienneBruines
Can I take the issue?

@EtienneBruines
Copy link
Author

@EtienneBruines EtienneBruines commented May 13, 2020

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
@nowres nowres linked a pull request that will close this issue May 13, 2020
6 of 13 tasks complete
@posva posva added the has PR label May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.