0
votes

In our Aurelia app we utilise barcode scanning on various dialogs. So we created a barcode component. When using a barcode scanner for this component we noticed that some characters are lost during scanning. Within the barcode component we utilise an input field to capture the input of the scanning or user typing into the field - on pressing the enter key the component sends an event containing the barcode - which the dialog intercepts and does some work.

I attempted to get this component to fail in the aurelia skeleton-navigation app (on github "skeleton-navigation\skeleton-typescript") as it does in our application however it works consistently - that is no characters are being lost.

I then went back to our app. If I reduce the barcode component to just a simple input field as below it also fails. If I take out the value.bind or value.two-way the input field has no loss of characters.

   <input type="text" value.bind="barcodeValue1"/>
   <input type="text" value.two-way="barcodeValue2"/>

There are many difference is the package.json file for example our app is using:

"aurelia-framework": "npm:aurelia-framework@^1.0.0-rc.1.0.2".

aurelia-skeleton is using:

"aurelia-framework": "npm:aurelia-framework@^1.0.0"

There is one solution we can see and that is to introduce a delay on the scanner between characters however we would like the binding to work and were also thinking it may be a bug in Aurelia. We are currently re-writing the component NOT to use the binding ability. The problem in our application occurs in Internet Explorer and works fine in Google Chrome.

1

1 Answers

0
votes

This is probably a bug in IE. I believe this problem can be solved by changing the updateTrigger to 'change'

<input type="text" value.bind="barcodeValue1 & updateTrigger:'change'"/>

You can also try debounce

<input type="text" value.bind="barcodeValue1 & debounce">

http://aurelia.io/hub.html#/doc/article/aurelia/binding/latest/binding-binding-behaviors/1

Make sure your scanner is pressing "enter" or "tab" after typing the code.