diff options
| author | Caitlin Potter | 2013-12-16 13:06:16 -0500 |
|---|---|---|
| committer | Caitlin Potter | 2014-02-12 20:28:13 -0500 |
| commit | 2b7302713674506fdbcdc396c38f18dcb90dee8c (patch) | |
| tree | e3a2ed5ba275ca01fe926a429a352c2c9002e53e /test/ng/directive/inputSpec.js | |
| parent | 1079105443145a85a47496591b5d249a223710f2 (diff) | |
| download | angular.js-2b7302713674506fdbcdc396c38f18dcb90dee8c.tar.bz2 | |
fix(input): setViewValue on compositionend
Because of a4e6d962, model is not updated on input/change between the
compositionstart and compositionend events. Unfortunately, the compositionend
event does not always happen prior to an input/change event.
This changeset calls the listener function to update the model after a
compositionend event is received.
Closes #6058
Closes #5433
Diffstat (limited to 'test/ng/directive/inputSpec.js')
| -rw-r--r-- | test/ng/directive/inputSpec.js | 11 |
1 files changed, 11 insertions, 0 deletions
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 |
