On 10/26/16, 11:58 PM, "yishayw" <yishayj...@hotmail.com> wrote:
>
>I was thinking that in general it could be nice to have an example of
>suppressing certain events in beads. The scenarios would be very similar
>to
>scenarios that require disabling all mouse events, which is what
>DisabledBead currently does. Sometimes there are a lot of event handlers
>on
>a single event and the simplest solution is to suppress the event rather
>than having all handlers check the target.
>

I think there may be more than one way to do this.  It may depend on what
you want to happen to any object behind the object under the mouse.  It is
one thing to suppress the event, and another to have it pass through to
the object behind.

What we end up doing may also depend on which event model we use which
depends on whether we wrap platform implementations or not.

If you don't need pass-through to objects behind, and aren't worried about
other beads on the strand listening for the event you want to block, I
think you can add a target listener in the strand setter and call
stopImmediatePropagation, and add a capture phase listener to the
topMostEventDispatcher.  Beads should have their strands set before most
other app-developer code starts to run.

There might be a better idea though.   I saw CSS pointer-events, but not
sure it works for non-SVG.

-Alex

Reply via email to