Android Auto-Rotate Disabled Not Respected with Discourse PWA


(Alex Bass) #1

This only happens with Discourse after you “add to homepage” (creating a Progressive Web App), once added, they don’t respect Auto-Rotate settings and keep rotating even when the setting is disabled on Android.

It’s incredibly frustrating since I always have “auto-rotate” turned off and it’s constantly switching between landscape and portrait view, especially when laying down on the couch or in bed on Discourse communities (Asana, Airtable, this community, etc.).

Edit: Video showing issue compared to non-Discourse PWA - https://photos.app.goo.gl/MZRm8gCMQS2AfJWP6


Manifest orientation property
(Jay Pfaffman) #2

Sounds like a problem with Android. The obvious solution is to just use your browser that works instead of the one that doesn’t. It’s unclear whether this can be solved on the Discourse side.


(Alex Bass) #3

That’s what I thought at first, but it is only happening with Discourse PWA’s, not happening with any other PWA’s we have set up and are using which brought me back to guessing it’s an issue with Discourse.

I rely incredibly heavily on the PWA’s for Discourse, jumping into each community from the home screen so simply just “using chrome directly” isn’t easy and a painful “workaround”.

I wouldn’t have posted in this community if I wasn’t fairly sure that it’s a Discourse issue moreso than an Android issue.


(Jay Pfaffman) #4

I’ve seen a similar report before, but I don’t remember it being so well-described.


(Alex Bass) #5

Here’s a video showing off the issue. As you can see, the only PWA that I open which respects screen-lock is the non-Discourse forum. You can see specifically when I visit the non-Discourse PWA for the 2nd time, the bottom-right corner shows the Android Pie screen-lock override control, whereas all of the Discourse forums just automatically rotate and it’s incredibly jarring :sweat_smile:

https://photos.app.goo.gl/MZRm8gCMQS2AfJWP6


(Jeff Atwood) #6

We had this enabled and people complained, as I recall. You can check with @Falco


(Alex Bass) #7

Thanks for the reply!

When you say that you had this enabled, what exactly did you have enabled? I’d assume that auto-rotate would be controlled by Android at a system-level across the board, why should a specific site be able to override it? If you take a look at the video I attached, you can see how jarring it is to the end-user. Discourse specifically is ignoring the auto-rotate setting.

And with Android Pie, they make it so easy to switch to landscape mode to temporarily override your auto-rotate setting by prompting you in the bottom-right corner:

So those who want to switch to landscape when they have auto-rotate turned off get the best of both worlds when just letting the system control this functionality.


(Joshua Rosenfeld) #8

Found @Falco’s last reply:

He says to use the OS option to stop rotation. The report here (which I can repro) is that the OS option is not respected. Seems like a #bug to me.

@codinghorror sounds like you’re remembering backwards.


(Alex Bass) #9

You got that exactly right :ok_hand::ok_hand: reading @Falco’s response is exactly how I would expect it to function and I could see why people would complain because that’s exactly what has been driving me nuts lately. No matter what I set my auto-rotate to, on or off, Discourse always acts as if auto-rotate is turned “on”. It’s completely ignoring the Android quick setting option, which is the suggestion that was given to stop it from constantly rotating. It has to be a bug.


(Rafael dos Santos Silva) #11

The actual last response is:

What is the orientation value you think we should use this time?


(Joshua Rosenfeld) #12

Whoops, sorry for finding the wrong post @Falco. Looks like you did remember correctly @codinghorror, apologies!

In my mind the correct value is whatever one respects the OS setting. If I have rotation lock on, the app shouldn’t be rotating. If I have auto-rotate on, the app should rotate like the OS does. Given that Android 9 supports locking the device in landscape, this will (hopefully) make everyone happy.

Side note, the Discourse Hub app functions as I just described above - it respects the OS.


(Alex Bass) #13

This is exactly how I feel as well.


(Rafael dos Santos Silva) #14

Duplicate