Skip to content

Generalize JSDoc for withIgnoreIMEEvents HOF to cover both keyDown and keyUp events #70097

@yogeshbhutkar

Description

@yogeshbhutkar

What problem does this address?

The withIgnoreIMEEvents higher-order function ignores keyboard events during IME (Input Method Editor) composition. These events are intended to interact with the IME itself rather than the host application. More detailed documentation on its usage can be found here:

/**
* A higher-order function that wraps a keydown event handler to ensure it is not an IME event.
*
* In CJK languages, an IME (Input Method Editor) is used to input complex characters.
* During an IME composition, keydown events (e.g. Enter or Escape) can be fired
* which are intended to control the IME and not the application.
* These events should be ignored by any application logic.

The documentation focuses on using the HOF with keyDown events, but keyUp events can also occur during IME composition. For accessibility, especially for CJK users, it's important to wrap both keyDown and keyUp handlers to ignore IME events.

Source:
https://developer.mozilla.org/en-US/docs/Web/API/Element/keyup_event#keyup_events_with_ime

What is your proposed solution?

Generalizing the docs will make this clearer.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions