vue-barcode-scanner icon indicating copy to clipboard operation
vue-barcode-scanner copied to clipboard

[Feature request] Before & After event

Open yuniit opened this issue 4 years ago • 4 comments

Thank for made this plugin it's easy to use and save me a lot of time, and I would like to request some features:

  • Before event: fire before barcode start scanning
  • After event: fire after barcode finished scanning

Thank again, these are my requests please let me know what you think about it

yuniit avatar Jul 16 '20 02:07 yuniit

I'ts a greeat idea, I'll find some time to improve this but, I't always welcome for any PR.

noomerzx avatar Jul 16 '20 02:07 noomerzx

Great idea. I have issue when user focus on an input and scan barcodes. I want to blur all focused inputs.

renwarkurd avatar Dec 29 '20 08:12 renwarkurd

I have fixed my issue with this

`

        const eventBus = this.$barcodeScanner.init((barcode) => {
            this.searchByBarcode(barcode)
        }, {
            eventBus: true,
        })

        if (eventBus) {
            eventBus.$on('start', (e) => { 
                if (e.target.tagName.toUpperCase() == 'INPUT') {
                    e.target.blur()
                }
             })
        }

`

renwarkurd avatar Dec 29 '20 08:12 renwarkurd

The code above worked well, but another issue happened, which blur first keypress on inputs.

renwarkurd avatar Dec 31 '20 19:12 renwarkurd