Subscribe on changes!

img tag attributes 'width, height' rendering with 0 value when 'null, undefined' specified

avatar
Nov 27th 2020

Version

3.0.3

Reproduction link

https://codesandbox.io/s/long-pond-gbdnl?file=/src/App.vue

Steps to reproduce

Insert an image via the img tag and specify width or height as null or undefined.

<img :width="null" :height="null" src="./assets/logo.png" />
<img :width="undefined" :height="undefined" src="./assets/logo.png" />

What is expected?

Attributes width and height have not been rendered according with the Vue 3 documentation - https://v3.vuejs.org/guide/template-syntax.html#attributes

What is actually happening?

Attributes width and height have been rendered with 0 value.

avatar
Nov 27th 2020

The attribute should be removed with nullish values. This would also make it consistent with Vue 2