Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-view-transitions-1] The ability for authors to re-enable pointer events #11596

Open
jespertheend opened this issue Jan 29, 2025 · 3 comments
Labels
css-view-transitions-1 View Transitions; Bugs only

Comments

@jespertheend
Copy link

I'm currently trying to make the below animation work using the view transitions api.
As you can see, the 'Subscribe with Google Pay' button is not clickable until the 'More payment options' link has appeared.
The same is true for the 'yearly billing' checkbox as well. This is because the modal itself is being resized as part of the same view transition.

The 'More payment options' link has a long delay for demonstration purposes. I intend to shorten the delay in the final result, so creating a second view transition for just that button isn't really an option either.

Screen.Recording.2025-01-29.at.15.09.18.mov
@bramus
Copy link
Contributor

bramus commented Jan 29, 2025

The problem you are having is that the ::view-transition overlay is catching all the clicks.

You can undo that by setting pointer-events to none on it.

::view-transition {
  pointer-events: none;
}

Note that the animated pseudos also don’t respond to hit testing, which can’t be undone.

See https://www.bram.us/2025/01/29/view-transitions-page-interactivity/ for more details.

@bramus bramus closed this as completed Jan 29, 2025
@bramus bramus added css-view-transitions-1 View Transitions; Bugs only Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. labels Jan 29, 2025
@jespertheend
Copy link
Author

Hey sorry I should have mentioned that I have already applied both

::view-transition {
  pointer-events: none;
}

and

:root {
  view-transition-name: none;
}

But in this case two buttons are animating and one finishes sooner than the other, unnecessarily keeping one of them unresponsive. So I can't really use these fixes here.

So what I'm asking here is for a way to individually control when each group's pseudo elements get removed and elements in the real dom become visible again.

You can’t undo this unresponsiveness on the groups and for good reasons:

  • The location on screen does not match the actual element’s location
  • What should be done when two different elements are transitioning from the one to the other: you could see the old one screen but then clicks would have to go to the new one?

I don't think these are an issue here. Since for this use case the animation of the individual group is already done, so swapping it out for the real dom prematurely shouldn't require any complex hit testing.

@bramus
Copy link
Contributor

bramus commented Jan 29, 2025

So what I'm asking here is for a way to individually control when each group's pseudo elements get removed and elements in the real dom become visible again.

I see. Different type of request indeed. Reopening.

@bramus bramus reopened this Jan 29, 2025
@bramus bramus removed the Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-view-transitions-1 View Transitions; Bugs only
Projects
None yet
Development

No branches or pull requests

2 participants