summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/less/web_editor.ui.less
diff options
context:
space:
mode:
authorAdrien Dieudonne <adr@odoo.com>2018-03-14 09:33:35 +0100
committerAdrien Dieudonne <adr@odoo.com>2018-03-20 16:21:20 +0100
commit3a74afd21eb12ca79a2f609b58f271278cae57cf (patch)
treea5214608970d5e0b7be4e8ddf598841bd827fe60 /addons/web_editor/static/src/less/web_editor.ui.less
parent5bc29744c9e605729632c6d2561156b886772058 (diff)
[FIX] barcodes: barcode scanning on Chrome mobile
Before this commit, the barcode value wasn't triggered on some Android devices with Google Chrome and using the Odoo app. In fact, the keypress event may not trigger with some devices. This is probably due to the fact that this event is marked as 'Legacy'. See: https://www.w3.org/TR/uievents/#legacy-keyboardevent-event-types To fix this, we can use 'keydown' event but we have to handle an other issue: there is no way to know which key is typed. The auto-suggest feature on Android invalidate all the following properties: Keycode, charCode, key, which, keyIdentifier, code. This is a well-known issue: https://bugs.chromium.org/p/chromium/issues/detail?id=118639 For more infos, please read this blog: https://www.outsystems.com/blog/javascript-events-unmasked-how-to-create-input-mask-for-mobile.html As a work around, we create a temporary input field that stores the barcode value. The focus is set on this input when a keydown is detected. Note that when an input has the focus, the android virtual keyboard will be opened. We can't avoid this behavior. The only thing we can do is to automatically close it after 800 ms. See: https://bugs.chromium.org/p/chromium/issues/detail?id=662386 As this fix is specific for Chrome only, it's not possible to test it easily. Some tests will be added in master.
Diffstat (limited to 'addons/web_editor/static/src/less/web_editor.ui.less')
0 files changed, 0 insertions, 0 deletions