Skip to content

Commit

Permalink
InputControl: Ignore IME events when isPressEnterToChange (#60090)
Browse files Browse the repository at this point in the history
* InputControl: Ignore IME events when `isPressEnterToChange`

* Add changelog

Co-authored-by: mirka <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: torounit <[email protected]>
  • Loading branch information
5 people authored Mar 22, 2024
1 parent 3230a61 commit 2ec46cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Bug Fix

- `InputControl`: Ignore IME events when `isPressEnterToChange` is enabled ([#60090](https://github.com/WordPress/gutenberg/pull/60090)).

## 27.2.0 (2024-03-21)

- `Dropdown` : Add styling support for `MenuGroup` ([#59723](https://github.com/WordPress/gutenberg/pull/59723)).
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/input-control/input-field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { useDragCursor } from './utils';
import { Input } from './styles/input-control-styles';
import { useInputControlStateReducer } from './reducer/reducer';
import type { InputFieldProps } from './types';
import { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';

const noop = () => {};

Expand Down Expand Up @@ -222,7 +223,7 @@ function InputField(
onBlur={ handleOnBlur }
onChange={ handleOnChange }
onFocus={ handleOnFocus }
onKeyDown={ handleOnKeyDown }
onKeyDown={ withIgnoreIMEEvents( handleOnKeyDown ) }
onMouseDown={ handleOnMouseDown }
ref={ ref }
inputSize={ size }
Expand Down

0 comments on commit 2ec46cc

Please sign in to comment.