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 <malfait.robin@gmail.com>
This commit is contained in:
Ernest
2022-09-14 21:01:34 +08:00
committed by GitHub
parent e926d693c5
commit e1f3ef862a
4 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
- Nothing yet!
### Fixed
- Prevent option selection in `Combobox.Input` while composing ([#1850](https://github.com/tailwindlabs/headlessui/issues/1850))
## [1.7.1] - 2022-09-12
@@ -713,6 +713,7 @@ let Input = forwardRefWithAs(function Input<
case Keys.Enter:
if (data.comboboxState !== ComboboxState.Open) return
if (event.nativeEvent.isComposing) return
event.preventDefault()
event.stopPropagation()
+3 -1
View File
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
- Nothing yet!
### Fixed
- Prevent option selection in `ComboboxInput` while composing ([#1850](https://github.com/tailwindlabs/headlessui/issues/1850))
## [1.7.1] - 2022-09-12
@@ -674,6 +674,7 @@ export let ComboboxInput = defineComponent({
case Keys.Enter:
if (api.comboboxState.value !== ComboboxStates.Open) return
if (event.isComposing) return
event.preventDefault()
event.stopPropagation()