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

Support input with form attribute #166

Open
maelanleborgne opened this issue Feb 21, 2025 · 0 comments
Open

Support input with form attribute #166

maelanleborgne opened this issue Feb 21, 2025 · 0 comments

Comments

@maelanleborgne
Copy link

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 ...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant