Cannot remove size attribute of <input>.
Version
3.0.11
Reproduction link
Steps to reproduce
- Open the link.
- Display error: Uncaught (in promise): Failed to set the 'size' property on 'HTMLInputElement': The value provided is 0, which is an invalid size.
What is expected?
Renders <input>
without the size attribute because I specified null for the size.
What is actually happening?
An error will occur.
Even if undefined
is given, an error will occur.
duplicate of https://github.com/vuejs/vue-next/issues/3294
Hi @edison1105.
That issue looked to me like <input :size="0">
issue.
This issue is <input :size="null">
issue.
How do I remove the size attribute?
Is this what you want?
<template>
<input ref="el" :size="size" >
</template>
<script>
export default {
data () {
return {
size: 1,
}
},
mounted(){
this.$refs.el.setAttribute('size',1)
this.$refs.el.removeAttribute('size')
}
}
</script>