Event.data should note it's not the `input` event data
http://bugs.jquery.com/ticket/14725
and suggest that people use event.originalEvent.data.
@ConnorCartwright I think this is another issue you could fix. Would you mind submit a PR?
Hey guys @AurelioDeRosa @dmethvin
Have the input and beforeinput events been renamed to beforeedit and edit events?
"beforeinput and input events renamed to beforeedit and edit events, respectively. These events are now defined by the Edit Events spec."
I created a small demo but I feel like I'm missing something or may have misunderstood:
$(" input.myInput ").on(" input ", {
name: 'Connor'
}, function(event) {
console.log(event.data);
console.log(event.originalEvent);
console.log(event.originalEvent.data)
});
Here event.data prints out the object with name: "Connor", but event.originalEvent.data is undefined.
I didn't realize the name changed last year. The latest spec is here?
https://w3c.github.io/editing/input-events.html#interface-InputEvent
I thought maybe it would pass data with contenteditable but that doesn't seem to be the case either:
https://jsfiddle.net/9v0mesn1/
I'm not sure because I've never used this event, maybe someone else knows?
Hey @AurelioDeRosa @dmethvin
Looks like input/before input are still in use.
In your jsfiddle, I'm assuming we should be seeing the content of the div as the event.originalEvent.data after we input? (i.e. if it's empty and you type in 'b', that should appear as the data)
@ConnorCartwright yes I expected there would be an event.data property in that fiddle (since it's a native event). Not sure why there isn't one.