-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent it from showing barcode #25
Comments
Bump! Im looking the exact same request, being able to preventDefault onScan, to avoid being pasted/typed anywhere whether its been focused or not. |
+1 to this too, at present I have resorted to manually clearing the input text's value inside the onScan. |
+1 - preventDefault for successful onScan would be ideal. |
In case it helps anyone else... The onScanError function gives you the key that was "rejected". So you can pass that to a function that handles keypresses |
anyone know how to this? I want it only to execute the function instead giving input to any input |
I've hacked it by checking the active input and removing the code that was written there during onScan.
Not great, but works for my use case, until we get something better. |
where did you put this code? @konstantin-klima |
Inside my event handler for OnScan:
|
Even I need this request in my project. Please let me know if there is any way to do that using onScan.js, Thanks |
I've found a bit of a hack for this:
The key parts are the onKeyProcess and onScanError, and making sure the validation options are pretty tight. Had to handle copy/paste a bit differently too. Prevent the possible valid scan chars getting emitted to the focused input, and append them to the value on the focused input if they don't turn out to be part of a scan. |
Hi,
How to execute a function without putting the barcode in any input?
Regardless of whether there is a focus or not, I only want to execute a function
Very good lib, congratulations
Carles
The text was updated successfully, but these errors were encountered: