Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/runtime-dom/__tests__/patchProps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,11 @@ describe('runtime-dom: props patching', () => {
expect(el.form).toBe(null)
expect(el.getAttribute('form')).toBe('foo')
})

test('readonly type prop on textarea', () => {
const el = document.createElement('textarea')
// just to verify that it doesn't throw when i.e. switching a dynamic :is from an 'input' to a 'textarea'
// see https://github.com/vuejs/vue-next/issues/2766
patchProp(el, 'type', 'text', null)
})
})
5 changes: 5 additions & 0 deletions packages/runtime-dom/src/patchProp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,10 @@ function shouldSetAsProp(
return false
}

// DOMprop "type" is readonly on textarea elements: https://github.com/vuejs/vue-next/issues/2766
if (key === 'type' && el.tagName === 'TEXTAREA') {
return false
}

return key in el
}