|
|
@@ -54,7 +54,7 @@ var TextInput = function(parentNode, host) {
|
|
|
if (useragent.isOldIE) text.style.top = "-1000px";
|
|
|
parentNode.insertBefore(text, parentNode.firstChild);
|
|
|
|
|
|
- var PLACEHOLDER = "\x01\x01";
|
|
|
+ var PLACEHOLDER = "\u2028\u2028";
|
|
|
|
|
|
var copied = false;
|
|
|
var pasted = false;
|
|
|
@@ -378,7 +378,7 @@ var TextInput = function(parentNode, host) {
|
|
|
// console.log("onCompositionUpdate", inComposition && JSON.stringify(text.value))
|
|
|
if (!inComposition || !host.onCompositionUpdate || host.$readOnly)
|
|
|
return;
|
|
|
- var val = text.value.replace(/\x01/g, "");
|
|
|
+ var val = text.value.replace(/\u2028/g, "");
|
|
|
if (inComposition.lastValue === val) return;
|
|
|
|
|
|
host.onCompositionUpdate(val);
|
|
|
@@ -402,7 +402,7 @@ var TextInput = function(parentNode, host) {
|
|
|
inComposition = false;
|
|
|
var timer = setTimeout(function() {
|
|
|
timer = null;
|
|
|
- var str = text.value.replace(/\x01/g, "");
|
|
|
+ var str = text.value.replace(/\u2028/g, "");
|
|
|
// console.log(str, c.lastValue)
|
|
|
if (inComposition)
|
|
|
return;
|
|
|
@@ -417,7 +417,7 @@ var TextInput = function(parentNode, host) {
|
|
|
// console.log("onCompositionEnd", str, c.lastValue)
|
|
|
if (timer)
|
|
|
clearTimeout(timer);
|
|
|
- str = str.replace(/\x01/g, "");
|
|
|
+ str = str.replace(/\u2028/g, "");
|
|
|
if (str == c.lastValue)
|
|
|
return "";
|
|
|
if (c.lastValue && timer)
|
|
|
@@ -429,6 +429,14 @@ var TextInput = function(parentNode, host) {
|
|
|
if (e.type == "compositionend" && c.range) {
|
|
|
host.selection.setRange(c.range);
|
|
|
}
|
|
|
+ // Workaround for #3027, #3045, #3097, #3100, #3249
|
|
|
+ var needsOnInput =
|
|
|
+ (!!useragent.isChrome && useragent.isChrome >= 53) ||
|
|
|
+ (!!useragent.isWebKit && useragent.isWebKit >= 603);
|
|
|
+
|
|
|
+ if (needsOnInput) {
|
|
|
+ onInput();
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
|