[FIX] web_editor: fix monetary fields Edition in FF
Changing value in monetary fields was not working properly in FF : The ZeroWidthSpace inserted by the deleteRange function cannot be selected; trying to do so loses the selection for some reason. task-2679088 closes odoo/odoo#80071 X-original-commit: 1b36b4e8a6b319de10b6c1144c37533dab0e2f36 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -175,6 +175,7 @@ export class OdooEditor extends EventTarget {
|
||||
this.document = options.document || document;
|
||||
|
||||
this.isMobile = matchMedia('(max-width: 767px)').matches;
|
||||
this.isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
||||
|
||||
// Keyboard type detection, happens only at the first keydown event.
|
||||
this.keyboardType = KEYBOARD_TYPES.UNKNOWN;
|
||||
@@ -1335,7 +1336,8 @@ export class OdooEditor extends EventTarget {
|
||||
const el = closestElement(joinWith);
|
||||
const { zws } = fillEmpty(el);
|
||||
if (zws) {
|
||||
setSelection(zws, 0, zws, nodeSize(zws));
|
||||
// ZWS selection in OdooEditor is not working in current version of firefox (since v93.0)
|
||||
setSelection(zws, 0, zws, this.isFirefox ? 0 : nodeSize(zws));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user