Skip to content

Commit e1f3ef8

Browse files
ErnestRobinMalfait
andauthored
Prevent option selection in ComboboxInput while composing (#1850)
* Fix should do nothing when event is fired within a composing session * update changelog * link to PR instead of issue Co-authored-by: Robin Malfait <[email protected]>
1 parent e926d69 commit e1f3ef8

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

packages/@headlessui-react/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
- Nothing yet!
10+
### Fixed
11+
12+
- Prevent option selection in `Combobox.Input` while composing ([#1850](https://github.com/tailwindlabs/headlessui/issues/1850))
1113

1214
## [1.7.1] - 2022-09-12
1315

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@ let Input = forwardRefWithAs(function Input<
713713

714714
case Keys.Enter:
715715
if (data.comboboxState !== ComboboxState.Open) return
716+
if (event.nativeEvent.isComposing) return
716717

717718
event.preventDefault()
718719
event.stopPropagation()

packages/@headlessui-vue/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
- Nothing yet!
10+
### Fixed
11+
12+
- Prevent option selection in `ComboboxInput` while composing ([#1850](https://github.com/tailwindlabs/headlessui/issues/1850))
1113

1214
## [1.7.1] - 2022-09-12
1315

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ export let ComboboxInput = defineComponent({
674674

675675
case Keys.Enter:
676676
if (api.comboboxState.value !== ComboboxStates.Open) return
677+
if (event.isComposing) return
677678

678679
event.preventDefault()
679680
event.stopPropagation()

0 commit comments

Comments
 (0)