inventree / InvenTree

Open Source Inventory Management System
https://docs.inventree.org
MIT License
3.9k stars 688 forks source link

"Scan barcode" modal does not accept any special characters #7529

Open tomvaneyck opened 1 week ago

tomvaneyck commented 1 week ago

Please verify that this bug has NOT been raised before.

Describe the bug*

When scanning a 2D supplier barcode using a USB barcode scanner into the "Scan barcode" modal, the Record and Group separator symbols do not get sent along to the server. I think this happens because these control characters get filtered out by the browser before they reach the input field.

Additionally, when the barcode scanner enters these characters using something like ctrl+ ] or ctrl + 6, these combinations still get sent to the browser itself, changing tabs or doing other stuff. As far as I can see this is because the input field in the modal only stops the propagation of keyup events, not the keydown events that actually trigger these shortcuts.

Steps to Reproduce

  1. Open the "Scan barcode modal"
  2. Scan a 2D barcode with record and group separators

Expected behaviour

The scanned characters get added to the input field and sent to the server.

Deployment Method

Version Information

Version Information:

InvenTree-Version: 0.15.4 Django Version: 4.2.12 Commit Hash: fa1a9da Commit Date: 2024-06-16

Database: postgresql Debug-Mode: False Deployed using Docker: True Platform: Linux-6.8.6-100.fc38.x86_64-x86_64-with Installer: DOC

Active plugins: False

Please verify if you can reproduce this bug on the demo site.

Relevant log output

No response

SchrodingersGat commented 6 days ago

@tomvaneyck can you submit a PR to address this? Happy to review :)

tomvaneyck commented 4 days ago

I'll give it a go when I have the time!

matmair commented 4 days ago

Should we assign you @tomvaneyck