You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I’m seeing a strange behavior with phx-change when my LiveView app is opened inside the Cypress browser (E2E runner). The same code works perfectly in a normal browser (Chrome/Firefox) in dev mode.
Environment
Elixir version (elixir -v): 1.19.4
Phoenix version (mix deps): 1.8.2
Phoenix LiveView version (mix deps): 1.1.8
Operating system: Linux (Arch)
Browsers you attempted to reproduce this bug on (the more the merrier): Chrome, Electron
Does the problem persist after removing "assets/node_modules" and trying again? Yes/no: Yes
Actual behavior
When running inside the Cypress browser:
Before the first phx-submit: phx-change behaves correctly.
After the first phx-submit on the form:
phx-change receives stale params (always one change behind).
This results in assigns/HTML also appearing one step behind the actual user input.
Expected behavior
phx-change should always receive the latest input value in params, regardless of whether a phx-submit has already been executed, and regardless of whether the app is opened in a normal browser or inside the Cypress runner.