[FIX] point_of_sale: fix numpad handling
The numpad in the PoS was sometimes handling events when it was not supposed to, leading to unexpected behavior. This was due to the fact we did not check if there was a buffer holder for the numpad before triggering the event handler. The check is now done by adding a check in the _onKeyboardInput method. closes odoo/odoo#159951 X-original-commit: d05220d797978b5f31f574c532c6a5a117b9f5b9 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
@@ -161,7 +161,10 @@ class NumberBuffer extends EventBus {
|
||||
: 0;
|
||||
}
|
||||
_onKeyboardInput(event) {
|
||||
return this._bufferEvents(this._onInput((event) => event.key))(event);
|
||||
return (
|
||||
this._currentBufferHolder &&
|
||||
this._bufferEvents(this._onInput((event) => event.key))(event)
|
||||
);
|
||||
}
|
||||
sendKey(key) {
|
||||
const event = new CustomEvent("", {
|
||||
|
||||
Reference in New Issue
Block a user