diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 228f5fb2366a..7d1bec7cfe9d 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -1306,9 +1306,9 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) { deferListener(event, this, this.value); }); - // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it + // if user modifies input value using context menu in IE, we need "paste", "cut" and "drop" events to catch it if ($sniffer.hasEvent('paste')) { - element.on('paste cut', deferListener); + element.on('paste cut drop', deferListener); } } diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js index 9c58807345d3..93d2184f969d 100644 --- a/test/ng/directive/inputSpec.js +++ b/test/ng/directive/inputSpec.js @@ -439,7 +439,7 @@ describe('input', function() { } }); - describe('"keydown", "paste" and "cut" events', function() { + describe('"keydown", "paste", "cut" and "drop" events', function() { beforeEach(function() { // Force browser to report a lack of an 'input' event $sniffer.hasEvent = function(eventName) { @@ -461,6 +461,18 @@ describe('input', function() { expect($rootScope.name).toEqual('mark'); }); + it('should update the model on "drop" event if the input value changes', function() { + var inputElm = helper.compileInput(''); + + browserTrigger(inputElm, 'keydown'); + $browser.defer.flush(); + expect(inputElm).toBePristine(); + + inputElm.val('mark'); + browserTrigger(inputElm, 'drop'); + $browser.defer.flush(); + expect($rootScope.name).toEqual('mark'); + }); it('should update the model on "cut" event', function() { var inputElm = helper.compileInput('');