Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

v4 - turbo breaks user menu on navigation #8577

Closed
thisismydesign opened this issue Dec 13, 2024 · 3 comments
Closed

v4 - turbo breaks user menu on navigation #8577

thisismydesign opened this issue Dec 13, 2024 · 3 comments

Comments

@thisismydesign
Copy link

Using v4.0.0.beta13. Navigating in the menu breaks the profile menu, so that it no longer opens on clicks after navigating in the menu. This seems to happen because of turbo. Removing import "@hotwired/turbo-rails" from application.js resolves the issue.

Possible solution:
application.js

document.addEventListener("turbo:load", () => {
  // trigger AA re-init
});
@tagliala
Copy link
Contributor

Hello, is it possible to have a reproducible test case?

Is it related to a problem where from the main application a user follows a link to the admin area?

PS: Please also use beta15 for the reproducible test case

@thisismydesign
Copy link
Author

I have an open source app that reproduces it: thisismydesign/wealth@0c96b79

docker-compose up should work out of the box with credentials in db/seeds/development.rb.

Otherwise, it's a simple rails 7 + importmaps + aa v4 setup.

Is there something I could call in the turbo hook to re-initialize AA's JS?

@tagliala
Copy link
Contributor

tagliala commented Dec 13, 2024

Thanks, I've tried to run it in docker but assets don't work (macOS Sequoia 15.2, Apple Silicon, docker 4.37.0 without login)

I can see that activeadmin is using a custom head partial which is importing application.js, but I don't know if this is a good practice

I would keep them separated.

Is there something I could call in the turbo hook to re-initialize AA's JS?

Maybe it is flowbite #8573

If it is flowbite support, please close this issue so we can use #8573 for discussion

@activeadmin activeadmin locked and limited conversation to collaborators Dec 13, 2024
@javierjulio javierjulio converted this issue into discussion #8578 Dec 13, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants