Use workaround from Ace's commits.

This commit is contained in:
Paulo Reis 2017-04-04 17:08:23 +01:00
parent c2df5dc01c
commit 2ac6b70a1c

View file

@ -1350,11 +1350,6 @@ if (typeof navigator != "object")
var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase();
var ua = navigator.userAgent;
var safariRegex = /version\/([\w\.]+).+?(mobile\s?safari|safari)/i;
var safariResult = ua.match(safariRegex);
var safariVersion = safariResult ? parseFloat(safariResult[1]) : 0;
exports.isWin = (os == "win");
exports.isMac = (os == "mac");
exports.isLinux = (os == "linux");
@ -1371,8 +1366,6 @@ exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined;
exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined;
exports.isSafari = safariVersion || undefined;
exports.isAIR = ua.indexOf("AdobeAIR") >= 0;
exports.isIPad = ua.indexOf("iPad") >= 0;
@ -2290,9 +2283,13 @@ var TextInput = function(parentNode, host) {
if (e.type == "compositionend" && c.range) {
host.selection.setRange(c.range);
}
// WORKAROUND: Accent keys and Korean keys don't work in Chrome >53.
// https://github.com/ajaxorg/ace/issues/3045
if (useragent.isChrome >= 53 || useragent.isSafari >= 10.1) onInput();
var needsOnInput =
(!!useragent.isChrome && useragent.isChrome >= 53) ||
(!!useragent.isWebKit && useragent.isWebKit >= 603);
if (needsOnInput) {
onInput();
}
};