msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
Other
23 stars 14 forks source link

Losing user input when typing fast after backspace #5035

Open Chris-Petty opened 1 month ago

Chris-Petty commented 1 month ago

What went wrong? 😲

If you press backspace and type relatively quickly (as a busy pharmacist might!), the state doesn't keep up and we end up deleting keystrokes after the backspaces. 356 +bsp +bsp + 2 + 5 may output 35 rather than 325. This is bad as it risks wrong quantities prescribed OR inaccurate stock levels if the user doesn't notice the system messing up their valid input.

https://github.com/user-attachments/assets/e51fe2a4-7e62-4403-a51e-79613d446f42

Also the general jank form some state control flipping the values about after typing...

Note this might be even worse/easier to reproduce on a keyboard just as it's easier to be fast.

Expected behaviour πŸ€”

No jank. Doesn't delete intended input.

How to Reproduce πŸ”¨

  1. Prescription edit a line
  2. have 3-4 digits
  3. quickly press backspace 1 or more times and type in new digits - you may loose some of your input.

(Might be a requirement for the prescription to be backdated, or perhaps to have many transactions affecting the stock line you are attempting to issue)

Your environment 🌱

lache-melvin commented 1 month ago

Agree, when busy and trying to work quickly, this could easily result in errors - as well as general frustration! Setting to normal as can be worked around, if we engage the prescription line peacefully 😁

Should be investigated how widespread this is though - is it the underlying input or a pattern in the prescription modal?

andreievg commented 1 month ago

Triage, just adding dispensing label to flag as something to look at in that bit of work. Can be quite frustrating to bruce lee