Fork me on GitHub
#reagent
<
2019-07-18
>
oskarkv10:07:06

I have two divs, let's call them a and b. Both of them have {:onMouseEnter f} maps in their [:div ...] vectors. Both have a single child. The only difference is that for a, the child does not take up all of the space of a, but for b, the child does take up all of the space of b. When I move the mouse cursor into them, event.target becomes a for a, but b's child for b. How come? I tried it with pure JavaScript, and it does not act like this. https://codepen.io/anon/pen/gVOWoG?editors=1111 Here, the parent always becomes the target.

oskarkv10:07:17

I tried adding padding to b, so that it, like a, was bigger than its child, and then b started becoming the event.target

oskarkv11:07:29

Oh, apparently addEventListener takes a third argument that affects this, useCapture

oskarkv11:07:20

Does anyone know of a way to give the argument I want to use for useCapture?

lilactown14:07:00

> The event handlers below are triggered by an event in the bubbling phase. To register an event handler for the capture phase, append Capture to the event name; for example, instead of using onClick, you would use onClickCapture to handle the click event in the capture phase.

lilactown16:07:12

is there any documentation on how ratoms/tracking/reactions actually are supposed to work?

lilactown16:07:24

I’m curious how ratoms/reactions handle disposal

sogaiu22:07:11

haven't found any - have been reading ratom.cljs and component.cljs and observing execution using dirac

sogaiu23:07:42

@lilactown fwiw, though i thought there were some inaccuracies, i got some related hints here about ratoms and components: https://www.reddit.com/r/Clojurescript/comments/9im81n/how_does_reframe_know_which_component_to_render/e6lrsc5/