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

fix: the value of display is sometimes incorrect with v-show #10297

Merged
merged 4 commits into from Feb 9, 2024

Conversation

zh-lx
Copy link
Contributor

@zh-lx zh-lx commented Feb 8, 2024

a optimize about #10161close #10151 and won't lead to the issue in #10294

For an element with v-show, when its style changes, el[vShowOldKey] is assigned as style.display, regardless of whether display exists in the style. If v-show === false and there is no display in style, the value of style.display is 'none' at this time, so el[vShowOldKey] will also be incorrectly assigned as 'none'.

The correct logic should be: el[vShowOldKey] = style.display only when display exists in the next style; otherwise, el[vShowOldKey] = ''.

Copy link

github-actions bot commented Feb 8, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 90.4 kB (+121 B) 34.4 kB (+54 B) 31 kB (+34 B)
vue.global.prod.js 148 kB (+121 B) 53.7 kB (+50 B) 48 kB (+81 B)

Usages

Name Size Gzip Brotli
createApp 50.5 kB (+90 B) 19.7 kB (+47 B) 18 kB (+39 B)
createSSRApp 53.8 kB (+90 B) 21.1 kB (+45 B) 19.2 kB (+79 B)
defineCustomElement 52.8 kB (+90 B) 20.5 kB (+51 B) 18.7 kB (+26 B)
overall 64.2 kB (+90 B) 24.8 kB (+42 B) 22.5 kB (+88 B)

@zh-lx
Copy link
Contributor Author

zh-lx commented Feb 9, 2024

@yyx990803 I think this is a correct fix about #10294? If just revert #10161, the issue about #10151 also will reproduce.

@yyx990803 yyx990803 merged commit c224897 into vuejs:main Feb 9, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@vue/compat: Bootstrap-Vue modals not properly displayed since Vue 3.4.9
2 participants