Page MenuHomePhabricator

[Bug] Scrolled search results cannot be followed on Wikipedia portal
Closed, ResolvedPublic5 Estimated Story Points

Description

Steps to reproduce

  1. Visit https://www.wikipedia.org
  2. Enter a letter into the search box
  3. Scroll the results
  4. Tap a result

If the page is scrolled, search result links cannot be followed. Tapping a link without scrolling or after dismissing the virtual keyboard works fine.

Expected results

  • Tapped result is followed

Actual results

  • Menu is dismissed

https://drive.google.com/file/d/1-5v1GyhS9Ps_d7UO95xvuNuWF3Oo2LmX/view?usp=sharing

Environments observed

  • Browser version: Chrome 73.0.3683.90
  • OS version: Android v9
  • Device model: Pixel v2
  • Device language: English

Check any additional observations

QA steps

page: www.wikipedia.org
browser/os: Chrome browser on an Android, Safari on iOS.
Verify the search suggestions that appear below the fold, are "clickable" on Chrome on Android, and remain clickable on other browsers such as iOS Safari.

  1. Type a search query into the search box,
  2. Click on a search suggestion that requires you to scroll below the fold
  • [ x] The search suggestions below the fold should lead to their respective pages
  • [x ] The search suggestions above the fold continue to function

Event Timeline

Niedzielski set the point value for this task to 5.

Possibly virtual keyboard related. Piotr and Nick are able to repro on phone. However, Nick says that if you only scroll a little it still works. This behaves differently on desktop / emulated device than mobile and may need analysis.

We pointed this task as a large given it's the frontpage of Wikipedia, only Jan has much experience working in the repo, and this issue might be dependent on the soft keyboard behaviors.

Jdlrobson renamed this task from [Bug] Scrolled search results cannot be followed to [Bug] Scrolled search results cannot be followed on Wikimedia portal.Apr 24 2019, 1:37 AM
Jdlrobson moved this task from Incoming to Upcoming on the Web-Team-Backlog board.

@ovasileva, this task is ready and just needs scheduling.

I dug into this a bit today, and this bug is interesting. It's not a problem with the CSS or positioning of the search suggestions, but it's tied to how Android handles blur events.

Essentially, when an input looses focus, it should emit a blur event, and then a click event on whatever was clicked. This works as expected when both the input and the clicked element are in the viewport, but things get funny when they're not.

When an input is scrolled past the viewport while it has focus, and then a blur event is triggered, the browser scrolls back up to make the input visible, instead of emitting the click event on the clicked element.

This behaviour is consistent when clicking on anything on the page, not just the search suggestions, and it happens on Chrome and Samsung Browser (I think both Blink based) Firefox on Android emits the click events correctly.

I made a codepen to reproduce this behaviour https://codepen.io/j4n/full/vwqYWa when tapping the input, then scrolling down and clicking a link, the link isn't followed, instead the browser scrolls back up to the input. One can also try scrolling past the search suggestions on the portal page and clicking on a project link, the browser will scroll back up as well.

I was about to decline this ticket because the bug seems to be an Android Chrome issue, but then I thought "how does the mobile wikipedia site handle this issue?" and I discovered that the mobile site triggers a blur event when a user scrolls down. That way, the browser doesn't scroll back up when something is clicked. The same approach can be applied here.

Change 525044 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[wikimedia/portals@master] Fix search suggestion clicking on Android Chrome.

https://gerrit.wikimedia.org/r/525044

Change 525044 merged by jenkins-bot:
[wikimedia/portals@master] Fix search suggestion clicking on Android Chrome.

https://gerrit.wikimedia.org/r/525044

Edtadros added subscribers: Jdlrobson, Edtadros.

@Jdlrobson I went through the steps to reproduce to become familiar with it. I don't' want to guess the steps. Do you want me to go through those steps on Mobile AMC-on, Mobile AMC-off, desktop logged-in, desktop logged-out?

Jdrewniak renamed this task from [Bug] Scrolled search results cannot be followed on Wikimedia portal to [Bug] Scrolled search results cannot be followed on Wikipedia portal.Aug 5 2019, 1:18 PM
Jdrewniak reassigned this task from Jdrewniak to Edtadros.
Jdrewniak updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)

No problems in Safari or Chrome or Firefox.