[TIMOB-16177]Edge case where orientationHistory returns first supported orientation that matches with the current window which does not match with the current orientation of the device.
[TIMOB-16177]Formatting issue.
Merge pull request #5225 from srahim/timob-16177

[TIMOB-16177]iOS: Orientation Bug with modal window