Skip to content

Commit 65bbacd

Browse files
authored
Ensure CMD+Backspace works in nullable mode for Combobox component (#1617)
* ensure cmd+backspace works The issue is that cmd+backspace technically already does work, but we only allowed it when the Combobox is in an open state. We can remove this check and apply the proper logic always. * update changelog
1 parent 90aa478 commit 65bbacd

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

packages/@headlessui-react/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Add `by` prop for `Listbox`, `Combobox` and `RadioGroup` ([#1482](https://github.com/tailwindlabs/headlessui/pull/1482))
1313
- Add `@headlessui/tailwindcss` plugin ([#1487](https://github.com/tailwindlabs/headlessui/pull/1487))
1414

15+
### Fixed
16+
17+
- Ensure `CMD`+`Backspace` works in nullable mode for `Combobox` component ([#1617](https://github.com/tailwindlabs/headlessui/pull/1617))
18+
1519
## [1.6.5] - 2022-06-20
1620

1721
### Fixed

packages/@headlessui-react/src/components/combobox/combobox.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,6 @@ let Input = forwardRefWithAs(function Input<
621621

622622
case Keys.Backspace:
623623
case Keys.Delete:
624-
if (data.comboboxState !== ComboboxState.Open) return
625624
if (data.mode !== ValueMode.Single) return
626625
if (!data.nullable) return
627626

packages/@headlessui-vue/CHANGELOG.md

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

1717
- Fix getting Vue dom elements ([#1610](https://github.com/tailwindlabs/headlessui/pull/1610))
18+
- Ensure `CMD`+`Backspace` works in nullable mode for `Combobox` component ([#1617](https://github.com/tailwindlabs/headlessui/pull/1617))
1819

1920
## [1.6.5] - 2022-06-20
2021

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,6 @@ export let ComboboxInput = defineComponent({
639639

640640
case Keys.Backspace:
641641
case Keys.Delete:
642-
if (api.comboboxState.value !== ComboboxStates.Open) return
643642
if (api.mode.value !== ValueMode.Single) return
644643
if (!api.nullable.value) return
645644

0 commit comments

Comments
 (0)