Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
yustnip opened this issue Nov 27, 2020 · 1 comment · Fixed by #2679
Closed
Labels
🐞 bug Something isn't working

Comments

@yustnip
Copy link

yustnip commented Nov 27, 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.

@posva posva added the 🐞 bug Something isn't working label Nov 27, 2020
@posva
Copy link
Member

posva commented Nov 27, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants