fix: scanning modal fixed close on scan
This commit is contained in:
@@ -20,10 +20,10 @@ const ScanningModal = ({
|
|||||||
|
|
||||||
useWindowEvent("keydown", (event) => {
|
useWindowEvent("keydown", (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
console.log(inputValues);
|
|
||||||
setInputValues(prevState => prevState + event.key);
|
setInputValues(prevState => prevState + event.key);
|
||||||
if (event.key === "Enter") {
|
if (event.key === "Enter") {
|
||||||
onScan(inputValues);
|
onScan(inputValues);
|
||||||
|
setInputValues("");
|
||||||
if (closeOnScan) {
|
if (closeOnScan) {
|
||||||
context.closeContextModal(id);
|
context.closeContextModal(id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user