diff options
| author | Christophe Matthieu <chm@odoo.com> | 2018-03-19 16:39:40 +0100 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-03-20 09:44:10 +0100 |
| commit | ec199222c34a9f3f7d40b3bf7af7881941d82017 (patch) | |
| tree | 7c10ccb6620e61032d2cb8239c15a48b6c2781ad /addons/web/static/lib/ace | |
| parent | d1dccd51309242c8e38e46320c38749eeb95062b (diff) | |
[FIX] web: ace: no duplicated char with composition (html/css editor)
Before this commit, there was an issue with input method using
composition in which typed characters were duplicated.
This was occuring until the composition ended.
This is a bug specific to Google Chrome v53+.
It has been fixed in the most recent version of ace.js [1],
and we just port the fix into our custom code.
Note that we do not simply import ace.js as a whole, because
we must update lots of custom code at the same time.
We plan to do so in the future.
Fixes #23629
[1] https://github.com/ajaxorg/ace/pull/3116
Diffstat (limited to 'addons/web/static/lib/ace')
| -rw-r--r-- | addons/web/static/lib/ace/ace.odoo-custom.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/addons/web/static/lib/ace/ace.odoo-custom.js b/addons/web/static/lib/ace/ace.odoo-custom.js index d8f84294316..49af24f5074 100644 --- a/addons/web/static/lib/ace/ace.odoo-custom.js +++ b/addons/web/static/lib/ace/ace.odoo-custom.js @@ -1173,15 +1173,16 @@ define("ace/lib/regexp", ["require", "exports", "module"], function(e, t, n) { if (!t.onCompositionEnd || t.$readOnly) return; var r = h; h = !1; - var i = setTimeout(function() { - i = null; + var i2 = setTimeout(function() { + i2 = null; var e = n.value.replace(/\x01/g, ""); if (h) return; e == r.lastValue ? w() : !r.lastValue && e && (w(), A(e)) }); k = function(n) { - return i && clearTimeout(i), n = n.replace(/\x01/g, ""), n == r.lastValue ? "" : (r.lastValue && i && t.undo(), n) - }, t.onCompositionEnd(), t.removeListener("mousedown", F), e.type == "compositionend" && r.range && t.selection.setRange(r.range) + return i2 && clearTimeout(i2), n = n.replace(/\x01/g, ""), n == r.lastValue ? "" : (r.lastValue && i2 && t.undo(), n) + }, t.onCompositionEnd(), t.removeListener("mousedown", F), e.type == "compositionend" && r.range && t.selection.setRange(r.range), + i.isChrome && i.isChrome >= 53 && O() }, I = o.delayedCall(j, 50); r.addListener(n, "compositionstart", B), i.isGecko ? r.addListener(n, "text", function() { |
