Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onInput and onKeyDown sequencing issue #2370

Open
weikequ opened this issue May 10, 2024 · 0 comments
Open

onInput and onKeyDown sequencing issue #2370

weikequ opened this issue May 10, 2024 · 0 comments

Comments

@weikequ
Copy link

weikequ commented May 10, 2024

Description

  • When both onInput and onKeyDown is used, onKeyDown should always fire before onInput, but with mathlive with React (not 100% sure if its caused by React), the order is switched with Backspace, Delete, and maybe others that I haven't tested. With Enter, the onKeyDown handler is not fired at all.
  • Edit: This is reproducible without react as well, see this codepen.

Steps to Reproduce

Visit this codepen: https://codepen.io/weikequ/pen/bGyGyEy?editors=1111

or

  1. Create a react project,
  2. Add in a mathlive element and a textarea element with oninput and onkeydown handlers that return a timestamp
  3. Observe differences in behaviour when using the keys mentioned above.

Actual Behavior

The order of the event handlers would be messed up or not fire at all (with Enter).

Expected Behavior

The order of the event handlers should always read onKeyDown first.

Environment

Latest version through unpkg.com

Operating System macOS 14.2.1

Browser Tested with Safari, Chromium (Electron), Firefox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant