- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 17
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
after fired turbo:render x-data not exists #36
Comments
@zodman Could you let me know if it was working with 1.0.4, please? |
yes |
@zodman Mmh, so it was working correctly with 1.0.4. Interesting. You can see a good example here -> #29 (comment) |
So... the issue is because you use a turbo-frame with an src attribute which is loaded after turbo triggered |
@SimoTod do you have the link of the way to do it with stimulus ? |
I don't have a link, unfortunately. I saw someone suggesting it on a turbo bug. I'm going to work on a solution but it will likely to be end of next week. |
@SimoTod what about a timeout function for fired before the turbo:render finish |
I'd rather avoid time based behaviors because they feel hacky, they are hard to test and they are even harder to debug when you have an issue. For example, a lazy loaded turbo frame is an http request so, on slow connection, it might take longer then the arbitrary timeout we pick. I'll implement something based on mutation observers. |
Hi @zodman could you test https://cdn.jsdelivr.net/gh/simotod/alpine-turbo-drive-adapter@feature/turbo-frame-support/dist/alpine-turbo-drive-adapter.min.js and let me know if it fixes your issue? Thanks |
Is this still an issue for you @zodman? The PR seems still on hold waiting for your feedback. Thanks. |
This seems to work how of the box with Alpine 3, can anyone confirm? (cc @lobre) |
I was just asking news before choosing turbo + alpine for a project (to be sure it was mature enough), so I was not exactly suffering from this problem. Maybe @zodman can confirm? Otherwise, as you said it seems OK to me with the new version at least. |
Hi guys, thanks for the connector, but a found a little issue:
I had this form:
as you can see the alpinejs works at the beginning. when the form submitted is succeed turbo reload the complete page.
and the alpinejs not working ....
What happened ?
The turbo:render fired but not found any dom node related alpine
document.querySelectorAll('[x-data]')
If I put on console the snippet
Now the alpinejs works...
TLDR; when turbo:render the ``document.querySelectorAll('[x-data]')` return empty and the window.Alpine.initializeComponent never happened.
The text was updated successfully, but these errors were encountered: