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

Update index.turbo.ts #928

Merged
merged 1 commit into from
Jul 24, 2024
Merged

Conversation

artinboghosian
Copy link
Contributor

@artinboghosian artinboghosian commented Jul 18, 2024

When a Turbo-Stream response is returned by Rails server the library intercepts before-render and fires a custom event after-render which calls initFlowbite. However, the before-render event handler dispatches the Event on the document rather than window where the after-render handler was defined. So the after-render handler never gets called.

This PR dispatches the Event on window where the after-render handler was defined.

The Events.init() function adds event listeners to the window, not the document. So the handler that is supposed to fire initFlowbite never gets called. Need to dispatch event on window where the event listener was attached.
@zoltanszogyenyi
Copy link
Member

Hey @artinboghosian,

Thanks for the PR. Merged!

Will release in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants