Search box gets stuck on Android Tablets

When accessing the search box on chrome 47.0.2526.83, android 5.1.0 (nexus 10) there is no way to dismiss the box in normal workflow.

  • taping outside the search has no effect
  • browser back dismisses he search, but also takes you back one page.
  • device back dismisses the keyboard, second back is the same as browser back.
  • navigating between browser tabs/apps, and whenever the keyboard is reactivated, search box snags text entry when coming back to this tab.
  • only way to dismiss and stay in your location is a page refresh. Given the performance/loading issues that Android has already, this seems suboptimal.

My workaround is that I have hacker’s keyboard installed. (full QWERTY + meta & arrow keys FTW!) All the standard shortcuts work, so I can just hit {escape}, but even I don’t use this keyboard for normal typing - it does not have swype yet - and most casual users would probably be totally lost.

2 Likes

Can you repro this @techapj?

On mobile (iOS/Android) we now take users to full page search as per this commit:

So tapping anywhere on the search page should have no effect as expected.


Hmm, I am not able to repro this on Android/iOS, back button takes me exactly to the exact position from where I tapped search icon.


Related topic:

https://meta.discourse.org/t/new-search-button-on-mobile-disrupts-navigation/33183?u=techapj


EDIT: I just noticed that Luke is using Nexus 10 tablet. I can’t be sure about Nexus 10 behaviour because I don’t own a Nexus tablet to test this on.

I tried to repro the same using Chrome device emulation and tapping outside the search box was working as expected:

2 Likes

Tap away from the box does not close it on my nexus.

I wonder if discourse is affected by the difference between right and left click, and perhaps a tap triggers as neither? I did try enabling “request desktop site” and got exactly zero difference, through the page did refresh when the setting was changed. Any thoughts on things I can try to help troubleshoot?

Does this also happen on iPad? That’s the closest analog.

works on iPad Air 2, but clicking search scrolls you up to the very top… But that may be because it is registering me on the Desktop version instead of the Mobile view.

1 Like

Yes, a Nexus 10 should also have the desktop view by default, just like iPad. Does it not?

Also portrait vs. landscape could be an issue, should be tried in both orientations.

Since checking “request desktop site” does absolutely nothing to my view, and everything (other than the search box) acts exactly like it does on my laptop, I’d say the default is working as intended.

Even handles being in portrait mode very well…

waitjustone… Sorry, I didn’t test before… This only happens in portrait mode. Landscape mode is fine, but I mostly compose in portrait, as I can then see part of the topic above the composer, and can scroll through while the keyboard is active. I also do searching while composing, as the search box is the best way of getting a direct link to a topic/post without actually opening a new tab and navigating around.

Still, unless we can repro this on iPad it’s going to be tough, since that implies it is an issue specific to your device.

Just borrowed an acer iconia 1 (7 in, 1024 x 600) Android 4.2.2.

Results: it displays my issue in both landscape and portrait mode. Discourse is defaulting to the desktop version on this tablet as well; full UI and small search drop down.

I am noting that every scenario that I have seen this happen yet, the viewport was narrow enough to display the “slimline” presentation. Only one avatar displayed per topic. The 7" tablet is small enough that this happens even in landscape mode.

Wonder if this is tied to the CSS for a narrower viewport? But I still can’t figure a way to repro on desktop, even when setting an emulator.

No repro on iPad pro with browser and Twitter sidebar simultaneously visible, in either orientation.

Another “test” tried Firefox mobile, just to see what happened…

  • Issue is extant, both in landscape and portrait mode
  • worse, any tap outside of the search box, in a signed out discourse instance, with keyboard up, leads to a weird triple flash, as the search box aggressively takes back cursor focus. Dismissing the keyboard apps this particular behavior.

Conclusion:

  • whatever is happening, its not specific to one layout engine/browser…
  • my guess about width dependent CSS was way off the mark.

Firefox is unsupported except on desktop (we only support the official default browsers on each mobile platform). Can you repro this in Firefox desktop?

Okay. Not able to repro on Firefox desktop. My point, though, was more that this is not unique to chrome/blink.

Not sure where to go next. I’m not a JS developer at all, but I’d be glad to plug into my computer and set up remote debugging with my desktop chrome, if anyone has an idea of what I might need to look for…

I can definitely repro this on my 2013 Nexus 7, Android 6, Chrome latest. In both orientations.

@eviltrout you should charge your Nexus 7 and try this it is super annoying.

2 Likes

Fixed here:

https://github.com/discourse/discourse/commit/eab9ad7b27acd08c9bbaa04da924bf1e84954aee

6 Likes

Thanks that was super annoying. Once I had the right device to repro, I knew exactly what you meant @Sailsman63 so thanks for staying on top of it.

4 Likes