diff options
| author | Tobias Bosch | 2013-11-22 16:34:33 -0800 | 
|---|---|---|
| committer | Tobias Bosch | 2013-11-22 17:02:21 -0800 | 
| commit | a090400f09d7993d102f527609879cdc74abae60 (patch) | |
| tree | e2fc4cba3509b32c00f33df2bf912246f3f5c7f9 /src/ng/directive/input.js | |
| parent | 84e0eea1645521f6a990a4dabeb53407db86eda2 (diff) | |
| download | angular.js-a090400f09d7993d102f527609879cdc74abae60.tar.bz2 | |
fix(input): Support form auto complete on modern browser
Although modern browser support the "input" event, they still only fire
the "change" event when they auto complete form elements
other than the currently selected one.
Related to #1460
Diffstat (limited to 'src/ng/directive/input.js')
| -rw-r--r-- | src/ng/directive/input.js | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index ea4d84f4..8307f7e8 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -449,15 +449,15 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {        deferListener();      }); -    // if user paste into input using mouse, we need "change" event to catch it -    element.on('change', listener); -      // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it      if ($sniffer.hasEvent('paste')) {        element.on('paste cut', deferListener);      }    } +  // if user paste into input using mouse on older browser +  // or form autocomplete on newer browser, we need "change" event to catch it +  element.on('change', listener);    ctrl.$render = function() {      element.val(ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue); | 
