Skip to content

Commit ab7752f

Browse files
committed
fix: patch translate as an attr
1 parent 5898629 commit ab7752f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/runtime-dom/__tests__/patchProps.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,11 @@ describe('runtime-dom: props patching', () => {
263263
)
264264
expect(el.value).toBe('baz')
265265
})
266+
267+
test('translate attribute', () => {
268+
const el = document.createElement('div')
269+
patchProp(el, 'translate', null, 'no')
270+
expect(el.translate).toBeFalsy()
271+
expect(el.getAttribute('translate')).toBe('no')
272+
})
266273
})

packages/runtime-dom/src/patchProp.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ function shouldSetAsProp(
105105
return false
106106
}
107107

108+
// #5462 translate is an enumerated attr, however its
109+
// corresponding DOM property are actually boolean.
110+
if (key === 'translate') {
111+
return false
112+
}
113+
108114
// native onclick with string value, must be set as attribute
109115
if (nativeOnRE.test(key) && isString(value)) {
110116
return false

0 commit comments

Comments
 (0)