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

Incorrect pageX, pageY values #21

Closed
cjolif opened this issue Apr 17, 2014 · 1 comment
Closed

Incorrect pageX, pageY values #21

cjolif opened this issue Apr 17, 2014 · 1 comment
Assignees
Milestone

Comments

@cjolif
Copy link
Contributor

cjolif commented Apr 17, 2014

If you run:

<html>
    <head>
        <script src="../../requirejs/require.js"></script>
        <script>require({baseUrl: "../.."}, ["dojo/domReady!"], function(events) {
            obj.addEventListener("touchmove", function (event) {
                span.innerHTML = event.touches[0].pageX;
                event.preventDefault();
            });
        });</script>
    </head>
    <body>
        <div id="obj" style="width: 640px; height: 480px; background-color: lightseagreen">
            HERE I AM
        </div>
        <span id="span" style="position: fixed; right: 0"></span>
    </body>
</html>

on an iPhone with the browser window being zoomed, you will see that pageX corresponds to the coordinate from the page top / left even if that top / left is not anymore visible due to zoom/offset.

If you run:

<html>
    <head>
        <script src="../../requirejs/require.js"></script>
        <script>require({baseUrl: "../.."}, ["dpointer/events", "dojo/domReady!"], function(events) {
            events.setTouchAction(obj, "none");
            obj.addEventListener("pointermove", function (event) {
                span.innerHTML = event.pageX;
                event.preventDefault();
            });
        });</script>
    </head>
    <body>
        <div id="obj" style="width: 640px; height: 480px; background-color: lightseagreen">
            HERE I AM
        </div>
        <span id="span" style="position: fixed; right: 0"></span>
    </body>
</html>

under the same conditions you will noticed that pageX will be relative to the visible part of the screen (so probably these is more clientX than pageX).

@seb-pereira seb-pereira self-assigned this Apr 28, 2014
@cjolif cjolif added the bug label May 6, 2014
@sbrunot
Copy link
Member

sbrunot commented Jul 3, 2014

Another side effect of this problem can be seen using the functional test page deliteful/tests/functional/StarRating.html: on iOS, if the page is scrolled, the stars do not respond anymore to move events.

wkeese added a commit to wkeese/deliteful that referenced this issue Jul 6, 2014
wkeese added a commit to wkeese/deliteful that referenced this issue Jul 6, 2014
@seb-pereira seb-pereira added this to the 0.3.0 milestone Aug 25, 2014
seb-pereira pushed a commit that referenced this issue Sep 3, 2014
…tion/properties definition. Add intern test (fixes #6).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants