https://linen.dev logo
Join Discord
Powered by
# ceramic
  • b

    billowy-waiter-28954

    03/01/2023, 4:28 PM
    You have a div inside another one
  • b

    billowy-waiter-28954

    03/01/2023, 4:28 PM
    the child div will always have priority over its parent
  • b

    billowy-waiter-28954

    03/01/2023, 4:29 PM
    The parent will catch events only if it doesn't hit the child it contains (given that the child also listens to the same event)
  • b

    billowy-waiter-28954

    03/01/2023, 4:29 PM
    If you don't want your child to steal focus, then your child shouldn't listen to the pointerOut/Over events
  • a

    ambitious-knife-25690

    03/01/2023, 4:30 PM
    The child isn't listening to them afaik 🤔
  • b

    billowy-waiter-28954

    03/01/2023, 4:30 PM
    I doubt it
  • a

    ambitious-knife-25690

    03/01/2023, 4:30 PM
    oh, hmm, it looks like you're right
  • a

    ambitious-knife-25690

    03/01/2023, 4:31 PM
    okay, so there's something here with haxeui that i'm not understanding
  • a

    ambitious-knife-25690

    03/01/2023, 4:32 PM
    thanks for talking me through this
  • a

    ambitious-knife-25690

    03/01/2023, 4:32 PM
    it might be that haxeui is applying event handlers in a way that may conflict with the ceramic behaviour here
  • b

    bright-gpu-74537

    03/01/2023, 5:17 PM
    im not sure thats accurate
  • b

    bright-gpu-74537

    03/01/2023, 5:22 PM
    my understanding (which may very well be wrong), is that in ceramic, in this example, you would only get a "inner" flash, accurate?
  • b

    billowy-waiter-28954

    03/01/2023, 6:12 PM
    Right, in Ceramic there will be only one element that catches the click
  • b

    billowy-waiter-28954

    03/01/2023, 6:12 PM
    But there is a way around it
  • a

    ambitious-knife-25690

    03/01/2023, 6:13 PM
    👀
  • b

    billowy-waiter-28954

    03/01/2023, 6:13 PM
    A visual can override
    interceptPointerDown()
    or
    interceptPointerOver()
    to block an event from being catched by a child, from a parent
  • a

    ambitious-knife-25690

    03/01/2023, 6:16 PM
    I did see that api, but, i'm not sure if it would work well with haxeui because it would require me to 1) the base type to a custom type, which i guess isn't super difficult but a user may not intuitively know they can treat
    HaxeuiVisual
    the same as a ceramic visual 2) I don't think this workaround would work in haxeui because components would some times have children which need pointer events
  • b

    billowy-waiter-28954

    03/01/2023, 6:25 PM
    Well, for 2) you can use the logic you want to block, or not the event
  • a

    ambitious-knife-25690

    03/01/2023, 6:28 PM
    haxeui backends don't have custom logic for a per component basis, unless there's a haxeui api that i'm unaware of
  • a

    ambitious-knife-25690

    03/01/2023, 6:29 PM
    and the main issue here is only 1 visual will get the event (in either) circumstance
  • b

    bright-gpu-74537

    03/01/2023, 6:29 PM
    no, thats accurate, they can cancel events though, but thats handled at the core level... ish
  • b

    bright-gpu-74537

    03/01/2023, 6:30 PM
    thats exactly the problem... if you had 10 visuals, all nested and all had handlers and clicked the "last" one, i would have expected 10 events to fire (assuming the mouse was in the bounds ofc)
  • a

    ambitious-knife-25690

    03/01/2023, 6:33 PM
    a visual does have a hit test with an x/y coord, could a potential workaround be I map screen events to componentimpl and just check if the mouse is in bounds?
  • a

    ambitious-knife-25690

    03/01/2023, 6:34 PM
    maybe its easier said than done
  • b

    bright-gpu-74537

    03/01/2023, 6:34 PM
    you could, but its a rats nest, you need to think about overlapping components, etc
  • b

    bright-gpu-74537

    03/01/2023, 6:34 PM
    i do it in kha (since it doesnt have any sprites or visuals or whatever) and it more complex than "is in bounds"
  • a

    ambitious-knife-25690

    03/01/2023, 6:35 PM
    another potential option.. hmm
  • a

    ambitious-knife-25690

    03/01/2023, 6:35 PM
    Every event attachment, i could attach the event to each child of a visual? 😅
  • a

    ambitious-knife-25690

    03/01/2023, 6:36 PM
    just loop over the children and add it
  • a

    ambitious-knife-25690

    03/01/2023, 6:37 PM
    ah, no nvm, it would still be only 1 event
1...878889...124Latest