Open paradox460 opened 1 year ago
Phoenix gained the ability to distinguish between which submit button was clicked in https://github.com/phoenixframework/phoenix_live_view/pull/2490. Unfortunately, this doesn't work with the default way surface handles form submit.
<Form>
name
value
<Form for={@changeset} trigger_action={false} submit="submit" change="change" > <button type="submit" name="submit" value="submit">Submit</button> <button type="submit" name="submit" value="save">save</button> </Form>
submit
I should see the submit value as either save or submit, depending on the button that was clicked. This is how it works in native Phoenix LiveView
save
Surface: v0.11.0 LiveView: v0.19.5 Elixir: 1.14.4-otp-25
Describe the bug
Phoenix gained the ability to distinguish between which submit button was clicked in https://github.com/phoenixframework/phoenix_live_view/pull/2490. Unfortunately, this doesn't work with the default way surface handles form submit.
How to reproduce it
<Form>
components, with 2 submit buttons. Ensure the submit buttons have aname
andvalue
attribute setsubmit
as a value in the params mapThe behavior you expected
I should see the
submit
value as eithersave
orsubmit
, depending on the button that was clicked. This is how it works in native Phoenix LiveViewYour Environment
Surface: v0.11.0 LiveView: v0.19.5 Elixir: 1.14.4-otp-25