Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| }); | ||
|
|
||
| document.getElementById('right-click-target').addEventListener('contextmenu', function (event) { | ||
| event.preventDefault(); |
There was a problem hiding this comment.
I'm wondering if we should add preventDefault()/stopPropagation() everywhere.
Some browsers, like MS Edge show a menu context menu when text is selected via double click, for instance.
There was a problem hiding this comment.
@uuf6429, this deserves a separate task/pr with research attached. Test suite doesn't really fail without them, but to avoid any future failing tests due to unexpected event propagation, this could be handy.
| </div> | ||
|
|
||
| <script type="text/javascript"> | ||
| document.getElementById('click-target').addEventListener('click', function () { |
There was a problem hiding this comment.
Just thinking out loud, could it make sense to use pointer events (which also capture touch etc) instead? Or do we maybe specifically want these mouse events?
I guess it's more of a question on the mink side - that touch events should be a different API?
There was a problem hiding this comment.
@uuf6429, we'd better create an issue in Mink repo itself for discussing such API.
Some ideas:
- understand underlying driver support for pointer events?
- how are js events triggered (does
mouse*event trigger matchingpointer*event and vice versa)? - how do mouse/pointer events behave on desktop/mobile devices?
- what about community-built Mink drivers (Chrome, Playwright, etc.)?
What I try to avoid here is by making the current mouse-api acting as point event API causing a break for desktop users. If we do introduce parallel pointer-api, then could drivers actually handle it without Syn-based magic.
Adds tests for click, double-click, right-click and mouse over on elements that are below the viewport. Each test scrolls to the top of the page first, so the element is outside the viewport when the driver method is called.
W3C drivers scroll the element into view for clicks themselves, but drivers that move the mouse to the element first may not. For example, MinkSelenium2Driver on Selenium 3 + Firefox fails with:
That's fixed in minkphp/MinkSelenium2Driver#389, which waited for a test like this.
Tested locally (macOS, Selenium jars, Brave 155 and Firefox 157):
🤖 Generated with Claude Code