Skip to content

fix(VProgressLinear): guard opacity against undefined props to prevent NaN in SSR#22880

Merged
J-Sek merged 1 commit into
vuetifyjs:masterfrom
mixelburg:fix/progress-linear-nan-opacity
May 31, 2026
Merged

fix(VProgressLinear): guard opacity against undefined props to prevent NaN in SSR#22880
J-Sek merged 1 commit into
vuetifyjs:masterfrom
mixelburg:fix/progress-linear-nan-opacity

Conversation

@mixelburg
Copy link
Copy Markdown
Contributor

@mixelburg mixelburg commented May 30, 2026

Fixes #22876

When bgOpacity or bufferOpacity props are unset, parseFloat(undefined) evaluates to NaN. In CSR the DOM silently rejects it, but in SSR Vue serializes NaN (which has typeof === "number") as opacity:NaN; in the HTML — invalid CSS that fails W3C validation.

Added null checks so the inline opacity is only set when the prop is explicitly provided. When unset, the CSS variable fallback (opacity: var(--v-border-opacity)) applies as intended.

@J-Sek J-Sek merged commit 359a492 into vuetifyjs:master May 31, 2026
9 checks passed
@J-Sek J-Sek added T: bug Functionality that does not work as intended/expected C: VProgressLinear labels May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: VProgressLinear T: bug Functionality that does not work as intended/expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report][4.0.7] v-progress-linear renders inline style "opacity: NaN" when bgOpacity / bufferOpacity props are unset

2 participants