I recently changed my <img /> to imported image tags, e.g <ImportedImage />, in which I found this weird behaviour. On the image there is a click-listener which works properly when it's just an img tag, but when its the imported image tag, the onClick$ gets fired an amount of times more for each click. So first click its fired once, then twice, then maybe 5, then 10 etc. In the example below, clicking on the left button 5 times then the right one 5 times causes it to fire 70-100 times. Depends on how fast you click for some reason. Clicking only the right one 5 times, it gets fired up to 25 times.
This specifically happens when the onclick$ is adding an element to an array within a useStore(), and the array gets mapped out to html on the same page.
If on the other hand the imported image tag is wrapped into a <div> and the div gets the onclick$ instead, this behaviour won't happen. So it seem to me to be a bug related between useStore() and the import image as JSX thingy.
Which component is affected?
Qwik Runtime
Describe the bug
I recently changed my
<img />
to imported image tags, e.g<ImportedImage />
, in which I found this weird behaviour. On the image there is a click-listener which works properly when it's just an img tag, but when its the imported image tag, theonClick$
gets fired an amount of times more for each click. So first click its fired once, then twice, then maybe 5, then 10 etc. In the example below, clicking on the left button 5 times then the right one 5 times causes it to fire 70-100 times. Depends on how fast you click for some reason. Clicking only the right one 5 times, it gets fired up to 25 times.This specifically happens when the
onclick$
is adding an element to an array within auseStore()
, and the array gets mapped out to html on the same page.If on the other hand the imported image tag is wrapped into a
<div>
and the div gets theonclick$
instead, this behaviour won't happen. So it seem to me to be a bug related betweenuseStore()
and the import image as JSX thingy.Reproduction
https://stackblitz.com/edit/qwik-starter-tqvtin?file=src%2Froutes%2Findex.tsx
Steps to reproduce
This behaviour happened both during testing localhost and when built and deployed to a domain.
System Info
Additional Information
I hope the report was done properly, haven't made one before :)