@@ -1046,17 +1046,35 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
1046
1046
stringBasedInputType ( ctrl ) ;
1047
1047
}
1048
1048
1049
+ function isKanji ( c ) {
1050
+ if ( ! c || c . length == 0 ) return false ;
1051
+ var code = c . charCodeAt ( 0 ) ;
1052
+ if ( code > 11904 && code < 12031 ) return true ; //CJK Radicals Supplement
1053
+ if ( code > 12352 && code < 12543 ) return true ; //Hiragana
1054
+ if ( code > 12736 && code < 19903 ) return true ;
1055
+ if ( code > 19968 && code < 40959 ) return true ; //CJK Unified Ideographs
1056
+ if ( code > 44032 && code < 55215 ) return true ; //Hangul Syllables
1057
+ if ( code > 63744 && code < 64255 ) return true ; //CJK Compatibility Ideographs
1058
+ if ( code > 65072 && code < 65103 ) return true ; //CJK Compatibility Forms
1059
+ if ( code > 131072 && code < 173791 ) return true ;
1060
+ if ( code > 194560 && code < 195103 ) return true ;
1061
+ return false ;
1062
+ }
1063
+
1049
1064
function baseInputType ( scope , element , attr , ctrl , $sniffer , $browser ) {
1050
1065
var type = lowercase ( element [ 0 ] . type ) ;
1051
1066
1052
1067
// In composition mode, users are still inputing intermediate text buffer,
1053
1068
// hold the listener until composition is done.
1054
1069
// More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent
1055
1070
if ( ! $sniffer . android ) {
1056
- var composing = false ;
1071
+ var composing = false ,
1072
+ msie11 = msie === 11 ,
1073
+ isCJK = false ;
1057
1074
1058
1075
element . on ( 'compositionstart' , function ( data ) {
1059
- composing = true ;
1076
+ composing = ! msie11 && true ;
1077
+ element . fire ( "compositionend" ) ;
1060
1078
} ) ;
1061
1079
1062
1080
element . on ( 'compositionend' , function ( ) {
@@ -1070,7 +1088,7 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
1070
1088
$browser . defer . cancel ( timeout ) ;
1071
1089
timeout = null ;
1072
1090
}
1073
- if ( composing ) return ;
1091
+ if ( ! msie11 && ! isCJK && composing ) return ;
1074
1092
var value = element . val ( ) ,
1075
1093
event = ev && ev . type ;
1076
1094
0 commit comments