Skip to content

Commit

Permalink
fix(date-input): inherit props and events (epicmaxco#4285)
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ksem authored May 25, 2024
1 parent 2827911 commit 0ffdb22
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
18 changes: 18 additions & 0 deletions packages/ui/src/components/va-date-input/VaDateInput.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,21 @@ export const NullValue = () => ({
<VaDateInput v-model="value" clearable manual-input clear-value="null" />
`,
})

export const EventListeners = () => ({
components: { VaDateInput },
data () {
return {
value: null,
}
},
methods: {
onKeydown () {
console.log('onKeydown')
},
},
template: `
[[value]]: {{ value === null ? 'null' : value }}
<VaDateInput v-model="value" @keydown="onKeydown" manual-input />
`,
})
1 change: 0 additions & 1 deletion packages/ui/src/components/va-date-input/VaDateInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ const VaDatePickerPropsDeclaration = extractComponentProps(VaDatePicker)
<script lang="ts" setup>
defineOptions({
name: 'VaDateInput',
inheritAttrs: false,
})
const props = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/utils/headless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const toNode = (v: any, attrs: NodeAttributes): VNode | null => {
}

if (typeof v.type.render === 'function') {
const component = h(v)
const component = h(v, attrs)

if (Array.isArray(component.children) && component.children.length > 1) {
return h('div', attrs, component.children)
Expand Down

0 comments on commit 0ffdb22

Please sign in to comment.