- From: Chong Zhang <notifications@github.com>
- Date: Thu, 15 Dec 2016 08:07:43 -0800
- To: w3c/uievents <uievents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 15 December 2016 16:08:40 UTC
@garykac
According to the usage in [InputEvent spec](https://w3c.github.io/input-events/#h-overview) `InputEvent.data` should be nullable. ([Link](https://w3c.github.io/uievents/#interface-inputevent) to the definition in UIEvent)
The reasons are:
1. `InputEvent.data` is not inherited from `UIEvent`, so it's OK to make it nullable;
2. `InputEvent` relies on the null check to tell JS which attribute they should use - `data` or `dataTransfer`;
3. We can't use `data == ""` in this case because:
* There are other `inputType`s (e.g. `'formatBold'`) that shouldn't have a `data` field, and having `data == ""` would make it confusing;
* It's possible for an IME to fire an `InputEvent` with empty text, which should still be valid (Not 100% sure if any browser is actually doing this though)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/116
Received on Thursday, 15 December 2016 16:08:40 UTC