Skip to content

Commit 0ffdb22

Browse files
authored
fix(date-input): inherit props and events (#4285)
1 parent 2827911 commit 0ffdb22

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

packages/ui/src/components/va-date-input/VaDateInput.stories.ts

+18
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,21 @@ export const NullValue = () => ({
234234
<VaDateInput v-model="value" clearable manual-input clear-value="null" />
235235
`,
236236
})
237+
238+
export const EventListeners = () => ({
239+
components: { VaDateInput },
240+
data () {
241+
return {
242+
value: null,
243+
}
244+
},
245+
methods: {
246+
onKeydown () {
247+
console.log('onKeydown')
248+
},
249+
},
250+
template: `
251+
[[value]]: {{ value === null ? 'null' : value }}
252+
<VaDateInput v-model="value" @keydown="onKeydown" manual-input />
253+
`,
254+
})

packages/ui/src/components/va-date-input/VaDateInput.vue

-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ const VaDatePickerPropsDeclaration = extractComponentProps(VaDatePicker)
115115
<script lang="ts" setup>
116116
defineOptions({
117117
name: 'VaDateInput',
118-
inheritAttrs: false,
119118
})
120119
121120
const props = defineProps({

packages/ui/src/utils/headless.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const toNode = (v: any, attrs: NodeAttributes): VNode | null => {
4242
}
4343

4444
if (typeof v.type.render === 'function') {
45-
const component = h(v)
45+
const component = h(v, attrs)
4646

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

0 commit comments

Comments
 (0)