Permalink
Browse files

[fix] point_of_sale: payment screen backspace

before the fix if hitting the backspace in point of paiment screen would
triger the keypress event twice.

removed the double eventhandler

resolves #29911

closes #30031
  • Loading branch information...
switch87 committed Jan 8, 2019
1 parent 13e47f5 commit 9246375b25f4e90000bb6e578aceb8a116dfc28a
Showing with 0 additions and 5 deletions.
  1. +0 −5 addons/point_of_sale/static/src/js/screens.js
@@ -1959,16 +1959,11 @@ var PaymentScreenWidget = ScreenWidget.extend({
$('body').keypress(this.keyboard_handler);
// that one comes from the pos, but we prefer to cover all the basis
$('body').keydown(this.keyboard_keydown_handler);
// legacy vanilla JS listeners
window.document.body.addEventListener('keypress',this.keyboard_handler);
window.document.body.addEventListener('keydown',this.keyboard_keydown_handler);
this._super();
},
hide: function(){
$('body').off('keypress', this.keyboard_handler);
$('body').off('keydown', this.keyboard_keydown_handler);
window.document.body.removeEventListener('keypress',this.keyboard_handler);
window.document.body.removeEventListener('keydown',this.keyboard_keydown_handler);
this._super();
},
// sets up listeners to watch for order changes

0 comments on commit 9246375

Please sign in to comment.