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: change teleport prop type order to fix boolean casting #798

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

mcmimik
Copy link

@mcmimik mcmimik commented Apr 1, 2024

This pull request addresses an issue with the teleport prop where it was not working correctly when passed as a boolean attribute without a value (e.g., <Datepicker teleport />).

image

This behavior was caused by the boolean casting rules in Vue 3, as described in the documentation: https://vuejs.org/guide/components/props.html#boolean-casting

By moving Boolean before String in the type array, the boolean casting rules are applied correctly, allowing the teleport prop to work as expected when used as a boolean attribute.

teleport: { type: [Boolean, String, Object] as PropType<boolean | string | HTMLElement>, default: null },

@Jasenkoo Jasenkoo merged commit cc668ac into Vuepic:main Apr 1, 2024
2 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.

None yet

2 participants