Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for input event simulation. #1892

Open
wants to merge 1 commit into
base: dev-master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/event-simulate/js/event-simulate.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ var L = Y.Lang,
keyEvents = {
keydown: 1,
keyup: 1,
keypress: 1
keypress: 1,
input: 1
},

//HTML events supported
Expand Down Expand Up @@ -96,13 +97,14 @@ Y.mix(bubbleEvents, touchEvents);
* the generated event object. This method does browser-equalizing
* calculations to account for differences in the DOM and IE event models
* as well as different browser quirks. Note: keydown causes Safari 2.x to
* crash.
* crash. Note: you'll need to include 'node-event-html5' module to listen
* to 'input' event.
* @method simulateKeyEvent
* @private
* @static
* @param {HTMLElement} target The target of the given event.
* @param {String} type The type of event to fire. This can be any one of
* the following: keyup, keydown, and keypress.
* the following: keyup, keydown, keypress, and input.
* @param {Boolean} [bubbles=true] Indicates if the event can be
* bubbled up. DOM Level 3 specifies that all key events bubble by
* default.
Expand Down Expand Up @@ -145,6 +147,7 @@ function simulateKeyEvent(target /*:HTMLElement*/, type /*:String*/,
case "keyup":
case "keydown":
case "keypress":
case "input":
break;
default:
Y.error("simulateKeyEvent(): Event type '" + type + "' not supported.");
Expand Down Expand Up @@ -949,4 +952,3 @@ Y.Event.simulate = function(target, type, options){


})();