Skip to content

Commit f385499

Browse files
fix v-model typescript error (#461)
* fix v-model typescript error * update changelog Fixes: #368 Fixes: #457 Closes: #459 Co-authored-by: Andrea Nanni <[email protected]>
1 parent cddcd29 commit f385499

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
### Fixes
1717

1818
- Fix form submission within Dialog ([#460](https://github.com/tailwindlabs/headlessui/pull/460))
19+
- Fix TypeScript types for `Listbox` and `Switch` ([#459](https://github.com/tailwindlabs/headlessui/pull/459), [#461](https://github.com/tailwindlabs/headlessui/pull/461))
1920

2021
## [@headlessui/react@v1.1.0] - 2021-04-26
2122

packages/@headlessui-vue/src/components/listbox/listbox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export let Listbox = defineComponent({
7878
props: {
7979
as: { type: [Object, String], default: 'template' },
8080
disabled: { type: [Boolean], default: false },
81-
modelValue: { type: [Object, String, Number, Boolean], default: null },
81+
modelValue: { type: [Object, String, Number, Boolean] },
8282
},
8383
setup(props, { slots, attrs, emit }) {
8484
let { modelValue, disabled, ...passThroughProps } = props
@@ -445,7 +445,7 @@ export let ListboxOption = defineComponent({
445445
name: 'ListboxOption',
446446
props: {
447447
as: { type: [Object, String], default: 'li' },
448-
value: { type: [Object, String], default: null },
448+
value: { type: [Object, String] },
449449
disabled: { type: Boolean, default: false },
450450
class: { type: [String, Function], required: false },
451451
className: { type: [String, Function], required: false },

packages/@headlessui-vue/src/components/switch/switch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export let Switch = defineComponent({
6161
emits: ['update:modelValue'],
6262
props: {
6363
as: { type: [Object, String], default: 'button' },
64-
modelValue: { type: [Object, Boolean], default: null },
64+
modelValue: { type: Boolean, default: false },
6565
class: { type: [String, Function], required: false },
6666
className: { type: [String, Function], required: false },
6767
},

0 commit comments

Comments
 (0)