gruhn / vue-qrcode-reader

A set of Vue.js components for detecting and decoding QR codes.
https://gruhn.github.io/vue-qrcode-reader
MIT License
2.03k stars 330 forks source link

When changing torch status it stop detecting codes #394

Closed gkucmierz closed 5 months ago

gkucmierz commented 7 months ago

Describe the bug When changing torch status it stop detecting qr codes.

To Reproduce change torch status

Screenshots Screenshot_20231120-113908

Smartphone (please complete the following information):

gkucmierz commented 7 months ago

Actually it stops tracking and detecting codes immediately after something on DOM is changed.

nitsir commented 7 months ago

+1 same issue In some cases can be fixed by toggling prop "paused", but not in all cases

gkucmierz commented 7 months ago

+1 same issue In some cases can be fixed by toggling prop "paused", but not in all cases

I noticed this too, but pausing & unpausing introduces unnecessary delay.

Sec-ant commented 7 months ago

Can anyone provide a simple demo where I can reproduce and check this issue?

gkucmierz commented 7 months ago

https://inspiring-hotteok-8764c2.netlify.app https://github.com/gkucmierz/qr-code

Sec-ant commented 7 months ago

@gkucmierz for your case, I think the reason is that you're passing constraints an object literal, which will cause component to re-render each time the template runs. You can use v-memo or composite the constraints object in the script and reference it at the props instead.

Nevertheless, re-rendering shouldn't break the component, so there might be something need to change on the vue-qrcode-reader side.

I have zero dev experience with Vue, let's hope someone else can take a closer look into this.

gkucmierz commented 7 months ago

@Sec-ant it helped https://github.com/gkucmierz/qr-code/commit/78c580f0f8e62b5017020b89d39eb5dc6ac0be08

But outline still freezes when torch status is changed.

github-actions[bot] commented 5 months ago

This issue has been marked as stale. If there is no further activity it will be closed.