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

Clicking a checkbox should not submit the form #1050

Open
blueyed opened this issue Jun 16, 2022 · 1 comment
Open

Clicking a checkbox should not submit the form #1050

blueyed opened this issue Jun 16, 2022 · 1 comment
Labels
bug django Relates to the Django client

Comments

@blueyed
Copy link
Contributor

blueyed commented Jun 16, 2022

Using a Django client, checkboxes are considered to be LxmlControlElements, where click then will submit the form:
https://github.com//cobrateam/splinter/blob/986ce0a10c52f08196b32b91f752182cb7517892/splinter/driver/lxmldriver.py#L421-L433

I've used browser.find_by_id("id_foo").first.click().
The workaround is using browser.check("foo").

@jsfehler jsfehler added the django Relates to the Django client label Jun 16, 2022
@andrewsmedina
Copy link
Member

I believe that to move the submit to inside the if self._control.get("type") == "submit": [0] bloc will fix this bug.

[0] - https://github.com//cobrateam/splinter/blob/986ce0a10c52f08196b32b91f752182cb7517892/splinter/driver/lxmldriver.py#L424

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug django Relates to the Django client
Projects
None yet
Development

No branches or pull requests

3 participants