Skip to content

Missing turbo:render event listener #1111

@paicha

Description

@paicha

Problem

Flowbite components stop working after form validation errors in Rails. They work on initial page load but become unresponsive after Turbo re-renders the page with a 422 response.

Root Cause

/src/index.turbo.ts currently listens to:

  • turbo:load
  • turbo:frame-load
  • turbo:after-stream-render

But it's missing turbo:render, which fires when Turbo replaces the entire page (like after form validation
errors). Without this listener, initFlowbite() never gets called and components remain dead.

Fix

Add this

  const turboRenderEvents = new Events('turbo:render', [initFlowbite]);
  turboRenderEvents.init();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions