Re: pointer-events="none" and an element's children

Jeff Schiller wrote:
> Question was raised whether if an element has pointer-events="none"
> and one of its children overrides pointer-events="all", can that child
> recevie the pointer event?

Yes.

> Please sse discussion here
> https://bugzilla.mozilla.org/show_bug.cgi?id=410820#c4
>
> Seems like if the parent element can't receive a pointer event, that
> means its children automatically do not because of the capture phase.
> Can the SVG WG clarify?  Can clarifications be added to the spec?

It's nothing to do with "capture phase", it's to do with CSS inheritance. The
'pointer-events' property is inherited, and therefore if a parent has
pointer-events="none" the children will inherit this value unless they override it.

Note that pointer-events only helps decide if an element is the _target_ of an
event, and therefore which element an event is targeted at. It does not stop
handlers on an element from being triggered if an event has been dispatched to
one of that element's children (because the child overrode pointer-events).

Jonathan

Received on Thursday, 21 February 2008 10:43:02 UTC