Re: [csswg-drafts] [css-display] Interaction gotchas when delaying the effect of `display: none` (#8389)

> The problem right now is that the _inert_ (and `pointer-events: none` — I'm not sure if the “inert” includes it?)

inert forces the browser to act as if we have `pointer-events: none` currently per the [html spec](https://html.spec.whatwg.org/multipage/interaction.html#inert-subtrees). This behavior was discussed in #6685.

Adding some thoughts to the different proposals:

> Proposed solutions:
> 
> 1. Only make the tooltip `inert` and `pointer-events: none` during the `duration`, but not during the `delay` when transitioning the `display` to `none`.

Currently the way that we make the node inert is by determining that the base style (i.e. style without animations) is `display: none`. This would require more complicated logic. E.g. if the base style is `display: none` and at least one animation animating display is in the active phase?

> 2. Keep the `inert` behavior as described in the issue, but still allow `pointer-events` both for the `duration` and the `delay` (this would make the usage for tooltips in line with how transition for `visibility` works).

I'm not sure I understand what you mean by "allow pointer-events"? Do you mean that the node would be inert but still hittable? I think this may be similar to my preferred behavior for inert https://github.com/w3c/csswg-drafts/issues/6685#issuecomment-1594973151 but we would need to flesh out the details about how we still ensure that the elements within will not be interacted with.

> 3. Allow developers to control the `inert` (and, if necessary `poiner-events`) during the transition, similar to how we can control the top layer transition via [`overlay`](https://drafts.csswg.org/css-position-4/#overlay) — I think this is a very similar case, and exposing the control for the `inert` only as a part of a transition seems like an ok idea?

I think there's two options here:

- Controlling inert via CSS was something we discussed as worth looking into if there were use cases - which this seems to be a good one for it. There have been previous concerns about this #7021 but perhaps they can be worked out.
- Alternately we could have similar logic to the overlay behavior as you mentioned where it can be transitioned but not set.

-- 
GitHub Notification of comment by flackr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8389#issuecomment-1594985376 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 16 June 2023 16:59:51 UTC