Page MenuHomePhabricator

[subtask bug] Focus search field does not work for the first time
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. go to reading web staging
  2. hard refresh
  3. tap on the magnifying glass

the layout goes into search mode but the textfield is not focused and keyboard is not popped up.

  1. do it again - and it works this time onwards

iOS 10.03
browser: safari or chrome

Event Timeline

Nirzar created this task.Jan 27 2017, 6:09 PM
Nirzar renamed this task from Focus search field does not work for the first time to [bug] Focus search field does not work for the first time .
Nirzar updated the task description. (Show Details)

Chrome and safari. both

Note I cannot replicate this on Chrome (desktop). In Chrome (Android) the input focuses but keyboard shows the first time. After refreshing it works correctly.

Note it's a different input and some browsers add constraints on focusing inputs programmatically (we've hit this issue a few times but never found good documentation on this issue).

I wrote chrome on iOS in the description.

Note it's a different input and some browsers add constraints on focusing inputs programmatically (we've hit this issue a few times but never found good documentation on this issue).

I had similar thought and if iOS has this restriction we can close the bug but then why does it work 2nd time around?

So it's very possible this is because the first visit to the search overlay is asynchronous and iOS Safari blocks certain events of this nature (see https://www.quora.com/Mobile-Safari-iPhone-or-iPad-with-JavaScript-how-can-I-launch-the-on-screen-keyboard)

@Jdlrobson okay, so it will require change in the first time search overlay method? if so, we can move it to the backlog.

Change 334698 had a related patch set uploaded (by Jdlrobson):
Do not lazy load search to focus search input in overlay in ios

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

โ€ข Jdlrobson renamed this task from [bug] Focus search field does not work for the first time to [subtask bug] Focus search field does not work for the first time .Jan 27 2017, 7:31 PM

Hmm, unfortunately, browserstack doesn't support iOS 10 yet, so I did a test on iOS 9.0 (iPhone 6S Plus). Here is the result. It's working correctly.

This comment was removed by Nirzar.

I was talking about auto-focus.

@bmansurov wrong bug lol sorry

are you doing a hard refresh? or try incognito?

Incognito is also working correctly.

@bmansurov hmm.. it's working on my device too. maybe jon put his patch on staging?

Change 334698 merged by jenkins-bot:
Do not lazy load search to focus search input in overlay in ios

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

Qgil removed a subscriber: Qgil.Jan 27 2017, 9:35 PM
Nemo_bis removed a subscriber: Nemo_bis.Jan 28 2017, 9:31 AM
phuedx assigned this task to Nirzar.Jan 30 2017, 10:15 AM

Signed off from design based on reading-web-staging

โ€ข Jdlrobson closed this task as Resolved.Jan 30 2017, 8:07 PM

tested - all done.