Opened 7 years ago

Last modified 5 years ago

#18763 new defect

dojo/dom-geometry.position(node, true) wrong on zoomed android device

Reported by: bill Owned by:
Priority: undecided Milestone: 1.14
Component: HTML Version: 1.10.4
Keywords: Cc:
Blocked By: Blocking:


While most dojo/dom-geometry methods like position(node) return the coordinates relative to the layout viewport (i.e. the viewport before pinch-zoom), docScroll() returns the scroll of the visual viewport (i.e. what is shown on the screen after pinch zoom).

Besides the inconsistency, this behavior breaks position(node, true) and subsequently placement of dropdowns (see #18454).

This problem is caused by a Chrome/Android? "bug" where document.scrollLeft and document.scrollTop are the scroll of the visual viewport rather than the layout viewport.

As explained in, the workaround is to change docScroll() to create a <div id=pagetopelement style="position:absolute;left:0;top:0"> and then call pagetopelement.getBoundingClientRect() on that <div>.

Based on dijit ticket #18454 but filing this ticket since it's really a core issue.

Change History (3)

comment:1 Changed 7 years ago by bill

#18753 is a duplicate of this ticket.

comment:2 Changed 7 years ago by dylan

Milestone: tbd1.12

Want to file a pull request for 1.11? Otherwise I'll look at this for 1.12.

comment:3 Changed 5 years ago by dylan

Milestone: 1.131.14
Note: See TracTickets for help on using tickets.