-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Feature] make scroll into view optional for page.click() #5716
Comments
To make sure I understand, you would want to say await page.click('text=Rename draft', { scroll: false }); It will click the center of the visible portion, so it'll work in this case. What signal would it give to you? Or are you worried about other elements that are not visible altogether? Or does your menu have overflow: auto? Trying to make sense of this! |
Thanks for your question @pavelfeldman
|
It looks like you don't care whether user is able to click it for real, you just want to trigger it, is that right? In that case you can just await page.dispatchEvent('(//li)[last()]', 'click') that's just trigger it programmatically. Playwright's way of clicking is 'tapping on the glass', i.e. as if user clicked it using pointer controller or finger tap. So if we don't scroll, we can't click... |
|
Could it be that one of the the click handlers in the page performs scrolling? If you try the following snippet it will dispatch 'click' without scrolling (while await page.goto('https://github.com/microsoft/playwright/issues/5716');
await page.dispatchEvent('text=is still scrolling the element', 'click'); |
@Nilsty Similarly to Yury, I don't see this happening anywhere in our code as well. I'll close this for now since it does look like |
Problem statement:
I have a dropdown menu where the bottom part is cut off. The elements which are cut off are still clickable as page.click() will scroll them into view. But I would like to make sure that all elements of the dropdown are fully visible without scrolling.
Proposed solution
My proposed solution would be to make the scrolling into view optional for page.click() as an option. E.g. scroll=false
Additional context
This issue seems somewhat related to #5700
The text was updated successfully, but these errors were encountered: