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

In Vue custom element, Boolean prop with default true cannot be updated to falsy value #12214

Closed
lejunyang opened this issue Oct 18, 2024 · 0 comments
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements

Comments

@lejunyang
Copy link

lejunyang commented Oct 18, 2024

Vue version

3.5.12

Link to minimal reproduction

https://play.vuejs.org/#eNqlVE2P0zAQ/SuDL0lENxUsXEpaQVEPcADEcrSEsumkZNexI3+UVlX/+07sJI1W3arSXpLx+L3x+PnZB/aladKtQzZjmSl01VgwaF0DIpebOWfWcLbgsqobpS0cQGM5gTWWlcSvzlhVrwTWKO2QVISUlIAjlFrVEFHxiEsuCyWNBdXYigKYw4FLgEarxsxCDFAqNcQAdt/gDJZKCczlpM/SMrkTdgZWO+yyx+5P/GWuX1EifL0AsW8t6WtpymkJcQLzBURtoxG8hTurK7kJ0JSSCeWivo1zAMonn/qVjr0o9Z70OCNq3KnVUgKylfeE7bUe4+isSojfFOM6Jt2gjaN6f2PR2ChJ4Nl0qHdCTKilUCwsu82FQ1qXTj/L5X4Rt8oFQDYNtiGT0MBi3YjcIo0AsntnrZLwuRBV8Uhm6su0bLIV6ezDbBqAl0llLkzP8vF1NCfD5tYddRhfR5dOiI7ZhteRoqijkBp2D8ab4BlVwzREneYwI3v0NTjzQ3LLKNPhr2Le3F+meh9dtWI2HZ0pm9CDQJYoq036YJSkV8PfD84KKlgJ1D+DEzkbbiFnuRDq/3efG9044vzD4vFM/sHs2hxnvzQa1FtqZZizuSYvh+nV3Q/cUTxM1mrtBKEvTP5Go4RrewywJfmB2h7hfLff/HtHp/bHrHYWpek35a07vBQklfPX8KWtn9q9TT94Hl17UvHvFnVbkwS8TT+m796z4xM7Itit

Steps to reproduce

click the buttons from left to right, observe the texts

What is expected?

Behavior of props default value in vue custom element should be same as in Vue component

What is actually happening?

We can see that boolean prop is always true in vue custom element no matter we set false, null, undefined or empty string, while in Vue component, false and null will be as it is, null, undefined and empty string will be default value

System Info

No response

Any additional comments?

No response

@lejunyang lejunyang changed the title In Vue custom element, Boolean prop with default true cannot be updated to false value In Vue custom element, Boolean prop with default true cannot be updated to falsy value Oct 18, 2024
lejunyang added a commit to lejunyang/core that referenced this issue Oct 18, 2024
@edison1105 edison1105 added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements labels Oct 20, 2024
noootwo pushed a commit to noootwo/core that referenced this issue Nov 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements
Projects
None yet
2 participants