reef icon indicating copy to clipboard operation
reef copied to clipboard

Second event handler not correctly registered

Open stephanebisson opened this issue 1 year ago • 7 comments

It appears that on an element having more than one event handlers (on* attributes), the second one is not correctly registered but the first and third ones are. I haven't tried with more than 3.

Test case: https://codepen.io/stephanebisson/pen/yLrWgzL?editors=1010

stephanebisson avatar Apr 30 '24 17:04 stephanebisson

The issue causing the second item to be skipped is that the previous attributes are being removed while the loop is still running. To fix this, we should wait until after the loop has finished to remove the attributes.

https://github.com/cferdinandi/reef/blob/ca459f09c34f3fa2314066655218e662e1050a01/src/components/render.js#L187-L194

hueitan avatar May 01 '24 19:05 hueitan

Fixed!

cferdinandi avatar May 07 '24 03:05 cferdinandi

According to this codepen, v13.0.4 broke this again

stephanebisson avatar May 16 '24 18:05 stephanebisson

According to this codepen, v13.0.4 broke this again

fixed on https://github.com/cferdinandi/reef/pull/204

hueitan avatar May 21 '24 07:05 hueitan

The PR above seems to fix the issue. @cferdinandi any chance you can have a look? thanks

stephanebisson avatar May 29 '24 17:05 stephanebisson

A recent update reintroduced this bug, unfortunately

cferdinandi avatar Aug 03 '24 02:08 cferdinandi