fix(runtime-dom): patch translate as an attr (#5485)

close #5462
This commit is contained in:
木杉
2022-04-13 17:16:33 +08:00
committed by GitHub
parent 154233abdb
commit 2c09969b13
2 changed files with 12 additions and 5 deletions

View File

@@ -79,13 +79,13 @@ function shouldSetAsProp(
return false
}
// spellcheck and draggable are numerated attrs, however their
// corresponding DOM properties are actually booleans - this leads to
// setting it with a string "false" value leading it to be coerced to
// `true`, so we need to always treat them as attributes.
// these are enumerated attrs, however their corresponding DOM properties
// are actually booleans - this leads to setting it with a string "false"
// value leading it to be coerced to `true`, so we need to always treat
// them as attributes.
// Note that `contentEditable` doesn't have this problem: its DOM
// property is also enumerated string values.
if (key === 'spellcheck' || key === 'draggable') {
if (key === 'spellcheck' || key === 'draggable' || key === 'translate') {
return false
}