On 2018/12/01 8:51, Eli Grey via dev-platform wrote:
I think the spec is confusing and not well-reasoned enough to introduce this 
misnomer. This change will make it so that there are two events with synonymous 
meaning, and only introduces potential site breakage.

The event is literally called "keypress", not "input". Developers are going to end up 
using it to track keypresses regardlessly due to the incorrect name. If they want to track input, that's what 
the "input" event is for.

"keypress" event was introduced by IE, and UI Events (formerly, called DOM Level 3 Events) defines the behavior from existing browsers, but marking them as "legacy".

Under current spec, "keydown" and "keyup" events represent "physical" event on the input device. "keypress" is "logical" event of text input from keyboard directly (i.e., not via IME). "input" and "beforeinput" are similar to "keypress", but they are fired only when an editor has focus and with any input devices/middle wares.

Currently, I'm working on implementing "beforeinput". It allows all web apps to stop handling "keypress" in the future and to prevent default action easier.

--
Masayuki Nakano <masay...@d-toybox.com>
Software Engineer, Mozilla
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to