mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Add new onInput event
'input' is supported in IE9+ and all other browsers according to https://developer.mozilla.org/en-US/docs/Web/API/window.oninput Test Plan: Modified ballmer-peak example to use onInput instead of onKeyUp and tested that it works properly on latest Chrome.
This commit is contained in:
@@ -211,6 +211,7 @@ function listenAtTopLevel(touchNotMouse) {
|
||||
trapBubbledEvent(topLevelTypes.topKeyUp, 'keyup', mountAt);
|
||||
trapBubbledEvent(topLevelTypes.topKeyPress, 'keypress', mountAt);
|
||||
trapBubbledEvent(topLevelTypes.topKeyDown, 'keydown', mountAt);
|
||||
trapBubbledEvent(topLevelTypes.topInput, 'input', mountAt);
|
||||
trapBubbledEvent(topLevelTypes.topChange, 'change', mountAt);
|
||||
trapBubbledEvent(
|
||||
topLevelTypes.topDOMCharacterDataModified,
|
||||
|
||||
@@ -32,6 +32,7 @@ var topLevelTypes = keyMirror({
|
||||
topDOMCharacterDataModified: null,
|
||||
topDoubleClick: null,
|
||||
topFocus: null,
|
||||
topInput: null,
|
||||
topKeyDown: null,
|
||||
topKeyPress: null,
|
||||
topKeyUp: null,
|
||||
|
||||
@@ -108,6 +108,12 @@ var SimpleEventPlugin = {
|
||||
captured: keyOf({onKeyDownCapture: true})
|
||||
}
|
||||
},
|
||||
input: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onInput: true}),
|
||||
captured: keyOf({onInputCapture: true})
|
||||
}
|
||||
},
|
||||
focus: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onFocus: true}),
|
||||
@@ -220,6 +226,7 @@ SimpleEventPlugin.topLevelTypesToAbstract = {
|
||||
topKeyUp: SimpleEventPlugin.abstractEventTypes.keyUp,
|
||||
topKeyPress: SimpleEventPlugin.abstractEventTypes.keyPress,
|
||||
topKeyDown: SimpleEventPlugin.abstractEventTypes.keyDown,
|
||||
topInput: SimpleEventPlugin.abstractEventTypes.input,
|
||||
topFocus: SimpleEventPlugin.abstractEventTypes.focus,
|
||||
topBlur: SimpleEventPlugin.abstractEventTypes.blur,
|
||||
topScroll: SimpleEventPlugin.abstractEventTypes.scroll,
|
||||
|
||||
Reference in New Issue
Block a user