arnog / mathlive

A web component for easy math input
https://cortexjs.io/mathlive
MIT License
1.56k stars 277 forks source link

onInput and onKeyDown sequencing issue #2370

Closed weikequ closed 3 months ago

weikequ commented 4 months ago

Description

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