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

Style value 0 (numeric) is not set in patchStyle #1506

Closed
xkam opened this issue Jul 5, 2020 · 1 comment
Closed

Style value 0 (numeric) is not set in patchStyle #1506

xkam opened this issue Jul 5, 2020 · 1 comment

Comments

@xkam
Copy link

xkam commented Jul 5, 2020

Version

3.0.0-beta.18

Reproduction link

https://codepen.io/activewidgets/pen/KKVQqOo?editors=0010

Steps to reproduce

create div with style="position:absolute; bottom:20px", change the bottom value to 0 (numeric)

What is expected?

style="position:absolute; bottom:0"

What is actually happening?

style="position:absolute"
i.e. bottom value disappears


The bug is likely in patchStyle() line 20 - https://github.com/vuejs/vue-next/blob/d4e9b19932dac686f57091e66f21a80d4c5db881/packages/runtime-dom/src/modules/style.ts#L20

instead of if (!next[key]) { it should be if (!next[key] && !next[key] === 0) {

@underfin
Copy link
Member

underfin commented Jul 5, 2020

#1504

@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants