Skip to content

Support input with form attribute #166

Description

@maelanleborgne

Description

Hello,

Just noticed that performing a click on a button linked to a specific form (with the form attribute) does not seem to be supported right now.

In addition, the formaction attribute is also ignored, though I don't think it's widely used so not really a priority.

Reproducer

Running this will submit on /another-action instead of /action

<form id="my-form" action="/action"></form>

<form action="/another-action">
    <button type="submit" form="my-form">Click me</button>
</form>
$this->browser()
// ...
    ->click('Click me')
;

Suggestion

I'd be happy to help, though I don't know where would the fix be done :

  • \Zenstruck\Browser\Session\KernelSession::formFor ?
  • \Zenstruck\Dom\Node\Form\Element::form ?
  • Directly in the click() method (though that would leave aside the fields ...)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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