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

ViewTransitions breaking Radix/Shadcn ui Dropdown Functionality in Astro App #10863

Open
1 task
desiboli opened this issue Apr 24, 2024 · 7 comments
Open
1 task
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: view transitions Related to the View Transitions feature (scope)

Comments

@desiboli
Copy link

desiboli commented Apr 24, 2024

Astro Info

Astro                    v4.6.2
Node                     v20.12.1
System                   macOS (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/mdx
                         @astrojs/sitemap
                         @astrojs/react
                         @astrojs/tailwind

If this issue only occurs in one browser, which browser is a problem?

📱 IPhone -> chrome & safari

Describe the Bug

After trying to figure out for a long time what could possibly be causing the bug I found out that after removing ViewTransitions from my head the Shadcn/ui dropdown-menu started to work as expected. When using ViewTransitions the dropdown-menu initially work but after navigating in my app (after a view transition) menu dropdown-menu is no longer clickable. Tried this only with the dropdown-menu component so far, but guessing this would effect other kinda similar components making Viewtransitions useless in the app.

What's the expected result?

The dropdown menu should maintain its full functionality and appearance regardless of ViewTransitions implementation.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-yi4ckh

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Apr 24, 2024
@matthewp
Copy link
Contributor

Please provide a minimal reproduction such as through https://astro.new/latest, not a link to your production website.

@matthewp matthewp added needs repro Issue needs a reproduction and removed needs triage Issue needs to be triaged labels Apr 24, 2024
Copy link
Contributor

Hello @desiboli. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

@desiboli
Copy link
Author

@matthewp I added a minimal reproduction (StackBlitz), sorry for the inconvenience!

@matthewp matthewp added needs triage Issue needs to be triaged and removed needs repro Issue needs a reproduction labels Apr 25, 2024
@martrapp
Copy link
Member

Hi @desiboli, I'm a bit lost. When I run you example with <ViewTransitions/> I can select the theme from the drop down, no matter how often i navigate to About and back. What am I doing wrong?

@martrapp martrapp added the needs response Issue needs response from OP label Apr 26, 2024
@desiboli
Copy link
Author

Hi @martrapp are you testing this on an iPhone with the safari or chrome browser ?
🙏

@martrapp martrapp removed the needs response Issue needs response from OP label Apr 26, 2024
@martrapp
Copy link
Member

Ah, I'm obviously too tired. Thank you for reading your issue to me. IPhone. Now I know what I am doing wrong. Thank you ;-)

@martrapp
Copy link
Member

Hi @desiboli, can confirm the issue now. While I'm able to reproduce it, I'm not able to debug it for lack of the necessary equipment.

To me it looks like the UI library looses its touch handlers. After view transitions handlers have to be reestablished as the DOM is changed by the view transition and the former elements from the previous page are gone. Normally, Astro's hydration takes care of this. What puzzles me is the fact that the issue only surfaces on mobile. I'll try to find someone who can help debugging this.

@matthewp matthewp added the - P3: minor bug An edge case that only affects very specific usage (priority) label May 3, 2024
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label May 3, 2024
@matthewp matthewp added the feat: view transitions Related to the View Transitions feature (scope) label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: view transitions Related to the View Transitions feature (scope)
Projects
None yet
Development

No branches or pull requests

3 participants