Page MenuHomePhabricator

Nearby scrolls the page even if it is not required
Closed, ResolvedPublic

Description

Clicking the icon automatically scrolls my window to 1 pixel below the top of the view frame. First, it shouldn't be messing with the scrolling to begin with. Second, it's especially annoying that even if you are already at the top of the page, it scrolls 1 pixel down. Using Firefox 25 on MacOS. Kaldari (talk) 15:14, 27 November 2013 (UTC)

Confirmed by me on Apple Safari 7 as well.


Version: unspecified
Severity: minor

Details

Reference
bz58482

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:22 AM
bzimport set Reference to bz58482.
bzimport added a subscriber: Unknown Object (MLST).

bingle-admin wrote:

Prioritization and scheduling of this bug is tracked on Mingle card https://wikimedia.mingle.thoughtworks.com/projects/mobile/cards/1510

delirium wrote:

I looked into this a bit. The scroll happens in all overlays that request "full-screen" using the mobile-overlay code in MobileFrontend/javascripts/common/Overlay.js. There's a deliberate window.scrollTo(0,1) that does it, with the comment "skip the URL bar if possible".

On desktop this is pointless, but on mobile it does succeed in "full-screening": in many mobile browsers, the URL-bar is shown iff the window is scrolled all the way to the top. So setting the scroll 1px down has the effect of hiding the URL-bar and giving the overlay fullscreen.

Possibilities:

  1. Is there a less hackish way of hiding the URL bar on mobile?
  1. Avoid scrolling on desktop.

A more general version of #2 is "properly manage overlays on desktop". The current bridge in MobileFrontend/javascripts/desktop is rather minimal and doesn't *really* produce overlays that work well on desktop. For example the X to close the overlay is currently broken on desktop (works on mobile), though perhaps a separate bug should be filed for that.

Hey DJ thanks for raising this. We will have to rethink the scrollTo mechanism.

Maybe the scroll top behaviour might be binded to an event which lives in the mobile codebase instead?
Or we could conditionally scroll to top based on user agent / mode / screen size.

I guess a generic mw.hook of mobile, or hooking it to specific detected devices yes

basil wrote:

I tested this on Android using the default browser, but I was not ale to reproduce this bug. Any tips?

delirium wrote:

On Android it works fine. The scrollTo behavior producing an unexpected UI effect (scrolling one pixel from the top) happens on desktop, for people who have enabled the Nearby beta feature.

Is this still an issue now the Nearby beta feature was disabled? I suspect the new version will not have this issue.

Closing as fixed because the UI has changed a lot since the bug was originally reported. Feel free to reopen if still an issue.