From ec30cadaaa1035f01bc3d3003ef5d9214a7bfa64 Mon Sep 17 00:00:00 2001 From: Andrea Nanni Date: Wed, 28 Apr 2021 00:26:26 +0200 Subject: [PATCH 1/2] fix v-model typescript error --- packages/@headlessui-vue/src/components/listbox/listbox.ts | 4 ++-- packages/@headlessui-vue/src/components/switch/switch.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@headlessui-vue/src/components/listbox/listbox.ts b/packages/@headlessui-vue/src/components/listbox/listbox.ts index 80935e7c56..ef1db2cb2b 100644 --- a/packages/@headlessui-vue/src/components/listbox/listbox.ts +++ b/packages/@headlessui-vue/src/components/listbox/listbox.ts @@ -78,7 +78,7 @@ export let Listbox = defineComponent({ props: { as: { type: [Object, String], default: 'template' }, disabled: { type: [Boolean], default: false }, - modelValue: { type: [Object, String, Number, Boolean], default: null }, + modelValue: { type: [Object, String, Number, Boolean] }, }, setup(props, { slots, attrs, emit }) { let { modelValue, disabled, ...passThroughProps } = props @@ -445,7 +445,7 @@ export let ListboxOption = defineComponent({ name: 'ListboxOption', props: { as: { type: [Object, String], default: 'li' }, - value: { type: [Object, String], default: null }, + value: { type: [Object, String] }, disabled: { type: Boolean, default: false }, class: { type: [String, Function], required: false }, className: { type: [String, Function], required: false }, diff --git a/packages/@headlessui-vue/src/components/switch/switch.ts b/packages/@headlessui-vue/src/components/switch/switch.ts index 8304be005e..6eb0f17830 100644 --- a/packages/@headlessui-vue/src/components/switch/switch.ts +++ b/packages/@headlessui-vue/src/components/switch/switch.ts @@ -61,7 +61,7 @@ export let Switch = defineComponent({ emits: ['update:modelValue'], props: { as: { type: [Object, String], default: 'button' }, - modelValue: { type: [Object, Boolean], default: null }, + modelValue: { type: Boolean, default: false }, class: { type: [String, Function], required: false }, className: { type: [String, Function], required: false }, }, From 3d5c0aead872c03933d8705afa5d845fa12c9cd3 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Wed, 28 Apr 2021 10:22:08 +0200 Subject: [PATCH 2/2] update changelog Fixes: #368 Fixes: #457 Closes: #459 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index afc146b552..e8b7c4d7ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixes - Fix form submission within Dialog ([#460](https://github.com/tailwindlabs/headlessui/pull/460)) +- Fix TypeScript types for `Listbox` and `Switch` ([#459](https://github.com/tailwindlabs/headlessui/pull/459), [#461](https://github.com/tailwindlabs/headlessui/pull/461)) ## [@headlessui/react@v1.1.0] - 2021-04-26