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: add v-bind="$attrs" to DatePicker in Calendar #117

Merged
merged 2 commits into from
Oct 21, 2023

Conversation

olemarius
Copy link
Contributor

Adding v-bind="$attrs" to DatePicker allows fine-grained control over the underlying v-calendar component's API.

@sadeghbarati
Copy link
Collaborator

@sadeghbarati
Copy link
Collaborator

IMO, let's wait for Infer attrs (Vue 3.4) cause v-calendar does not provide any types to set it easily in the defineProps section

@olemarius
Copy link
Contributor Author

@sadeghbarati thanks for pointing that out! Also agree it's better to wait for Infer attrs, wasn't aware of that rfc.

So for now, the workaround is to modify your own local copy of the Calendar.vue component with

defineOptions({
  inheritAttrs: false
})

and

<DatePicker 
  v-bind="$attrs" 
  ...  
/>

Copy link
Member

@zernonia zernonia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@zernonia zernonia merged commit 03e1fce into radix-vue:dev Oct 21, 2023
1 check failed
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

3 participants