Skip to content

Commit

Permalink
Prevent option selection in ComboboxInput while composing (#1850)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Ernest and RobinMalfait committed Sep 14, 2022
1 parent e926d69 commit e1f3ef8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/@headlessui-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion packages/@headlessui-vue/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit e1f3ef8

Please sign in to comment.