diff options
Diffstat (limited to 'addons/barcodes/static/src')
| -rw-r--r-- | addons/barcodes/static/src/js/barcode_events.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/barcodes/static/src/js/barcode_events.js b/addons/barcodes/static/src/js/barcode_events.js index 546faee3655..fca30916106 100644 --- a/addons/barcodes/static/src/js/barcode_events.js +++ b/addons/barcodes/static/src/js/barcode_events.js @@ -129,6 +129,10 @@ var BarcodeEvents = core.Class.extend(mixins.PropertiesMixin, { // Don't catch keypresses which could have a UX purpose (like shortcuts) if (e.ctrlKey || e.metaKey || e.altKey) return; + // Don't catch Return when nothing is buffered. This way users + // can still use Return to 'click' on focused buttons or links. + if (e.which === 13 && this.buffered_key_events.length === 0) + return; // Don't catch events targeting elements that are editable because we // have no way of redispatching 'genuine' key events. Resent events // don't trigger native event handlers of elements. So this means that |
