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

Submitted forms don't carry the "submitter" attribute #709

Open
paradox460 opened this issue Sep 11, 2023 · 0 comments
Open

Submitted forms don't carry the "submitter" attribute #709

paradox460 opened this issue Sep 11, 2023 · 0 comments

Comments

@paradox460
Copy link

Describe the bug

Phoenix gained the ability to distinguish between which submit button was clicked in phoenixframework/phoenix_live_view#2490. Unfortunately, this doesn't work with the default way surface handles form submit.

How to reproduce it

  1. Create a form using <Form> components, with 2 submit buttons. Ensure the submit buttons have a name and value attribute set
    <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>
    
  2. Attempt to submit the form using either button. You will not see the submit as a value in the params map

The behavior you expected

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

Your Environment

Surface: v0.11.0
LiveView: v0.19.5
Elixir: 1.14.4-otp-25

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

No branches or pull requests

1 participant