mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
fix(scenario): don't trigger input events on IE9
input.enter() should trigger 'change' rather than 'input' event on IE9 because input events on IE9 are broken and angular doesn't rely on them
This commit is contained in:
@@ -198,13 +198,13 @@ angular.scenario.dsl('binding', function() {
|
||||
*/
|
||||
angular.scenario.dsl('input', function() {
|
||||
var chain = {};
|
||||
var supportInputEvent = 'oninput' in document.createElement('div');
|
||||
var supportInputEvent = 'oninput' in document.createElement('div') && msie != 9;
|
||||
|
||||
chain.enter = function(value, event) {
|
||||
return this.addFutureAction("input '" + this.name + "' enter '" + value + "'", function($window, $document, done) {
|
||||
var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':input');
|
||||
input.val(value);
|
||||
input.trigger(event || supportInputEvent && 'input' || 'change');
|
||||
input.trigger(event || (supportInputEvent ? 'input' : 'change'));
|
||||
done();
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user