Skip to content

Make viewport getScrollLeft return 0 instead of accessing dom #7355

@muxin

Description

@muxin

Since we don't allow scroll horizontally on the document by setting overflow-x: hidden on html and #i-amphtml-wrapper, the viewport.getScrollLeft() in different viewport binding will always return 0.

I see we are using viewport.getScrollLeft only in analytics and here. It's basically useless and always returns 0. We could either remove the method or simply return 0 without accessing the dom.

To minimize the change, I suggest we always return 0 in viewport.getScrollLeft

@dvoytenko @jridgewell

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions