Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

sendEvent('click', x, y) will not work if point is outside viewportSize #10302

Closed
ariya opened this issue Dec 10, 2011 · 4 comments
Closed

sendEvent('click', x, y) will not work if point is outside viewportSize #10302

ariya opened this issue Dec 10, 2011 · 4 comments
Labels

Comments

@ariya
Copy link
Owner

ariya commented Dec 10, 2011

kk7...@gmail.com commented:

Version:
phantomjs-1.3.0-win32-dynamic.zip

Description:
sendEvent('click', x, y) does not work when the point is outside the default viewportSize of width: 400 and height: 300.

Suggestion:
sendEvent should ignore viewportSize and work if the point is within the page width and height.

Disclaimer:
This issue was migrated on 2013-03-15 from the project's former issue tracker on Google Code, Issue #302.
🌟   4 people had starred this issue at the time of migration.

@ariya
Copy link
Owner Author

ariya commented Apr 23, 2012

downch...@gmail.com commented:

It ought to set appropriate variables in the MouseEvent. Something like clientX = x%viewportWidth, pageX = x. There may be some tricky areas in here because of scrolling expectations.

Current work-around is simply to set the viewport height large enough to capture the click then set it back to a smaller height so the render doesn't overdraw the area.

@ariya
Copy link
Owner Author

ariya commented May 1, 2012

downch...@gmail.com commented:

I wasn't able to get the viewport to go back down to a "smaller height"; so extra work with clip is probably necessary for workarounds.

@AndrewRayCode
Copy link

delvarwo...@gmail.com commented:

In addition to it "not working" - if clicking outside the viewport area it will trigger a click event on the root HTML element with the correct clientX and clientY populated. but even if there is a valid element at those coords it will not be clicked.

I think at least a good temporary behavior would be to throw an error if trying to click outside of the viewport area. Right now there is no indication that anything has gone wrong.

@ghost ghost removed old.Priority-Medium labels Dec 19, 2017
@stale stale bot added the stale label Dec 26, 2019
@stale
Copy link

stale bot commented Dec 29, 2019

Due to our very limited maintenance capacity (see #14541 for more details), we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed. In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants