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

[6.x] Try clicking all elements before throwing ElementClickInterceptedException #989

Merged
merged 3 commits into from
Jul 25, 2022
Merged

Conversation

SjorsO
Copy link
Contributor

@SjorsO SjorsO commented Jul 25, 2022

Currently, if you try to click() a selector that appears multiple times on the page, it will match the first one and click it. This causes trouble when working with nested modals.

For example, I have a base modal that has dusk="close-modal" on the close button. If I have nested modals, I can't reliably click that close button with ->click('@close-modal'). Depending the order of the modals in the html, it will either work or throw the following exception:

ElementClickInterceptedException: element is not clickable. Other element would receive the click

image

This PR changes the click() method to try and click all matching elements before throwing the ElementClickInterceptedException exception. This change should be fully backwards compatible.

@taylorotwell taylorotwell merged commit cd93e41 into laravel:6.x Jul 25, 2022
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

Successfully merging this pull request may close these issues.

2 participants