Openbravo Issue Tracking System - POS2
View Issue Details
0049977POS2Corepublic2022-08-09 11:582022-08-09 12:00
AugustoMauch 
meriem_azaf 
normalminorhave not tried
closedfixed 
5
 
22Q3 
No
0049977: Buttons which opens popups are focused when popup is closed
Buttons which opens popups are focused when popup is closed

See this link [https://stackoverflow.com/questions/69047336/material-ui-closing-modal-leaves-focus-state-on-button-that-opened-it [^]]

It causes a problem in POS if after closing a popup a code which includes "whitespaces" is scanned because the button with the focus is pressed again
In live buids
Login in POS2
In main window add a product to the order
Press delete order button
Close de confirmation popup by pressing cancel or clicking on the background
See that focus is in delete order button again
Press space -> confirmation dialog is shown

When doing a scan with a REAL barcode scanner (cannot be simulated through dev tools console) a space press key event is triggered and the confirm dialog is shown again
Add prop disableRestoreFocus on dialog base component
No tags attached.
related to defect 0049872 closed meriem_azaf Buttons which opens popups are focused when popup is closed 
Issue History
2022-08-09 11:58AugustoMauchNew Issue
2022-08-09 11:58AugustoMauchAssigned To => meriem_azaf
2022-08-09 11:58AugustoMauchTriggers an Emergency Pack => No
2022-08-09 11:58AugustoMauchIssue generated from0049872
2022-08-09 12:00AugustoMauchNote Added: 0140000
2022-08-09 12:00AugustoMauchTypedefect => backport
2022-08-09 12:00AugustoMauchStatusnew => scheduled
2022-08-09 12:00AugustoMauchStatusscheduled => resolved
2022-08-09 12:00AugustoMauchResolutionopen => fixed
2022-08-09 12:00AugustoMauchStatusresolved => closed
2022-08-19 14:16AugustoMauchRelationship addedrelated to 0049872

Notes
(0140000)
AugustoMauch   
2022-08-09 12:00   
Pushed to 22Q3 branch with wrong issue number:

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^] [^]
Changeset: 04a65f406d08a6d176b4beac0020cb6f743a9eb3
Author: Meriem Azaf <meriem.azaf@openbravo.com>
Date: 09-08-2022 10:49:50
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/04a65f406d08a6d176b4beac0020cb6f743a9eb3 [^] [^]

Fixes ISSUE-49872: Buttons which opens popups are focused when popup is closed

Buttons which opens popups are focused when popup is closed.

It causes a problem in POS if after closing a popup a code which includes "whitespaces" is scanned because the button with the focus is pressed again.

To fix this, we added disableRestoreFocus on dialog base component as a prop.

---
M web-jspack/org.openbravo.core2/src/components/BaseDialog/BaseDialog.jsx