@@ -1103,11 +1103,11 @@ function stringBasedInputType(ctrl) {
11031103}
11041104
11051105function textInputType ( scope , element , attr , ctrl , $sniffer , $browser ) {
1106- baseInputType ( scope , element , attr , ctrl , $sniffer , $browser ) ;
1106+ baseInputType ( scope , element , attr , ctrl , $sniffer , $browser , 'text' ) ;
11071107 stringBasedInputType ( ctrl ) ;
11081108}
11091109
1110- function baseInputType ( scope , element , attr , ctrl , $sniffer , $browser ) {
1110+ function baseInputType ( scope , element , attr , ctrl , $sniffer , $browser , type ) {
11111111 var type = lowercase ( element [ 0 ] . type ) ;
11121112
11131113 // In composition mode, users are still inputing intermediate text buffer,
@@ -1126,7 +1126,10 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
11261126 } ) ;
11271127 }
11281128
1129- var timeout ;
1129+ var timeout , oldVal ;
1130+ if ( type === 'text' ) {
1131+ oldVal = element . val ( ) ;
1132+ }
11301133
11311134 var listener = function ( ev ) {
11321135 if ( timeout ) {
@@ -1152,10 +1155,17 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
11521155 }
11531156 } ;
11541157
1158+ function ieListener ( ev ) {
1159+ var val = element . val ( ) ;
1160+ if ( val === oldVal ) return ;
1161+ oldVal = val ;
1162+ listener ( ev ) ;
1163+ }
1164+
11551165 // if the browser does support "input" event, we are fine - except on IE9 which doesn't fire the
11561166 // input event on backspace, delete or cut
11571167 if ( $sniffer . hasEvent ( 'input' ) ) {
1158- element . on ( 'input' , listener ) ;
1168+ element . on ( 'input' , msie ? ieListener : listener ) ;
11591169 } else {
11601170 var deferListener = function ( ev , input , origValue ) {
11611171 if ( ! timeout ) {
0 commit comments