inertia-rails icon indicating copy to clipboard operation
inertia-rails copied to clipboard

event handlers are not bounded, with hydrateRoot

Open lakshmajee opened this issue 3 years ago • 0 comments

Versions:

  • inertia_rails version: 3.0

Describe the problem:

The javascript event listeners are not attached to the HTML even after hydrating. Example: let's assume there is an event handler registered for an input field named name. Whenever the user changes the value in the text field, the event listeners should fire.

Steps to reproduce:

Reproduction repository: https://github.com/awkward-minion/inertiajs-react-form-handlers.git

The browser renders this problem without any issues. But the event handlers like handleSubmit and handleChange are not registered after the hydration.

Observations

  1. SSR is properly generating HTML markup along with layout
  2. Client-side hydrateRoot was not displaying any warnings, considering it as good. The javascript bundle is being loaded in the browser. (the event handlers)
  3. Problem - the event handlers are not bonded

Raised issue in inertia.js rails repository

lakshmajee avatar Oct 10 '22 19:10 lakshmajee