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

[Feature] page.click() scroll to be optional #11716

Closed
godjira-homless opened this issue Jan 28, 2022 · 4 comments
Closed

[Feature] page.click() scroll to be optional #11716

godjira-homless opened this issue Jan 28, 2022 · 4 comments

Comments

@godjira-homless
Copy link

I have several problems in jqxgrid with page.click(). Click 2 rows upper than the element located (hover too), etc (jqx bug). I think the problem cause the Scroll the element into view if needed in click().
It could be nice to if scroll would be optional.
workaround: mouse.click() to bounding box, but I'd rather use the page.click()
thx

@aslushnikov
Copy link
Collaborator

It could be nice to if scroll would be optional.

@godjira-homless If the element is outside of the viewport, than we can't click it with mouse; same way as users won't be able to.
You can try using locator.dispatchEvent:

await page.locator('button').dispatchEvent('click');

@godjira-homless
Copy link
Author

I can move the slider to the appropriate position, the element in the viewport, visible, all condition ok.
Everything is fine with a click. After the click the grid behaves strangely - your mouse on line 5, but the pointer on line 3.
I'm sure the problem is with the grid! My intuition is caused by the scroll in the click(). Possible not...
Playwright click working fine, no problem with it. If I can select scroll to false, then maybe the grid not going to crazy.
dispacthEvent not working - no error, nothing happening.
In trace log:
waiting for selector "div[id='row10target_grid']>div:nth-of-type(10)>div>a:nth-of-type(2)"
selector resolved to <a is="tooltip-component" i18n-title="tooltip.more"…>

I tried different selectors, same result.

@yury-s
Copy link
Member

yury-s commented Jan 31, 2022

There is no way to disable scroll step as a human would also have to scroll the element into view to be able to click it. It might be that there is a bug in the app and how it reacts to scrolling. It may be that the element is not yet stable when playwright is clicking it, there were some fixes in 1.18 related to that. What version are you using? If you are not on 1.18 can you please try it and see if the problem persists?

If the problem is still there can you share a trace with us?

@pavelfeldman
Copy link
Member

We need more information to act on this report. Please file a new one and link to this issue when you get back to it!

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

No branches or pull requests

4 participants