From a10f3e4ea73481b16c14a3703d8def2488d25b20 Mon Sep 17 00:00:00 2001 From: Prajwalit Bhopale Date: Wed, 2 Jul 2014 16:43:03 +0530 Subject: [PATCH] Add support for input event simulation. --- src/event-simulate/js/event-simulate.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/event-simulate/js/event-simulate.js b/src/event-simulate/js/event-simulate.js index 52fc5094af2..93b83c5ebb4 100644 --- a/src/event-simulate/js/event-simulate.js +++ b/src/event-simulate/js/event-simulate.js @@ -45,7 +45,8 @@ var L = Y.Lang, keyEvents = { keydown: 1, keyup: 1, - keypress: 1 + keypress: 1, + input: 1 }, //HTML events supported @@ -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. @@ -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."); @@ -949,4 +952,3 @@ Y.Event.simulate = function(target, type, options){ })(); -