react-native-orientation-locker icon indicating copy to clipboard operation
react-native-orientation-locker copied to clipboard

Android triggers an orientations change event when device laid down flat

Open trobbertze opened this issue 6 years ago • 5 comments

Hi

In Android when you lay your device down flat on a table an orientation change event is fired.

This is not problematic per se, but the issue is that the orientation event always fires with value 'PORTRAIT', even though the phone was in landscape orientation when you laid it down.

This does not happen on IOS.

I am on version 1.1.5 with RN - 0.59.9

trobbertze avatar Jul 01 '19 13:07 trobbertze

Very likely it's your devices' specific issue. What's your HW? Works fine on my LG v30.

coder89 avatar Jul 05 '19 20:07 coder89

I don't think so, we tested on multiple devices over here and the results were consistent.

I don't have my device on me at the moment, its a Samsung, will have to get back to you with the exact model name. But like I said we saw this behaviour across many different devices.

trobbertze avatar Jul 08 '19 07:07 trobbertze

I have noticed a similar issue on my S8. The orientation event listener is being fired without the actual screen making an orientation change. Slight angling of the device alone will emit the event. This causes some of my UI which is dependant on this listener to change regardless of actual screen orientation change. This might be solved by using the non-device listener however, with the screen locked to any landscape mode (as the documentation mentions) that will not work. Should this continue to be an issue I may tackle this.

JavanPoirier avatar Jul 17 '19 11:07 JavanPoirier

@trobbertze did you get any solution for rotation problem?

shubham696 avatar Jan 21 '20 20:01 shubham696

@JavanPoirier I am also experiencing this issue with the slight angling triggering orientation change. Do you have any plans to address the problem?

uqpgeor2 avatar Nov 27 '22 10:11 uqpgeor2