diff options
| -rw-r--r-- | src/ng/directive/input.js | 1 | ||||
| -rw-r--r-- | test/ng/directive/inputSpec.js | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 3c09c084..09e07d36 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -447,6 +447,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) { element.on('compositionend', function() { composing = false; + listener(); }); } diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js index 668fa0b5..b9f737ac 100644 --- a/test/ng/directive/inputSpec.js +++ b/test/ng/directive/inputSpec.js @@ -509,6 +509,17 @@ describe('input', function() { }); } + it('should update the model on "compositionend"', function() { + compileInput('<input type="text" ng-model="name" name="alias" />'); + if (!(msie < 9)) { + browserTrigger(inputElm, 'compositionstart'); + changeInputValueTo('caitp'); + expect(scope.name).toBeUndefined(); + browserTrigger(inputElm, 'compositionend'); + expect(scope.name).toEqual('caitp'); + } + }); + describe('"change" event', function() { function assertBrowserSupportsChangeEvent(inputEventSupported) { // Force browser to report a lack of an 'input' event |
