Page MenuHomePhabricator

In jQuery.IME on Chromium, Backspace doesn't clear context
Open, LowPublic

Description

Steps to reproduce:

  1. In Chromium, go to http://thottingal.in/projects/js/jquery.ime/examples/ and select Malayalam transliteration.
  2. Press 'c' twice. The text becomes: ക്ക്
  3. Press 'c', again. The text becomes: ക്ക്ൿ
  4. Press Backspace. The text reverts to: ക്ക്
  5. Press 'h'.

Observed behaviour:
At step 5, the text becomes: ച്ച് - that is, ക്ക്h has been transliterated in the context 'cc' (as if steps 3 and 4 had never happened).

Expected behaviour (as seen on Firefox):
At step 5, the text becomes: ക്ഖ് - that is, ക്ക്h has been transliterated in the context ''.

Reason:
This happens because jQuery.IME clears the context on backspace keypress, but Chromium doesn't fire keypress events for backspace or many other non-character keys. Instead, the context should be cleared on backspace keydown.