7
Views
1
Comments
Solved
[Screen Orientation Plugin] ResolveOrientation Bug
Question
Forge component by Experts
5
Published on 18 Jun 2020
Application Type
Mobile

I think there is a bug in the github project for seting the orientation. 

The function resolveOrientation  is checking if the OrientationLockType has a property called 'orientation', but in reallity it should be checking for the value of orientation. E.g:portrait, landscape etc..

function resolveOrientation (orientation, resolve, reject) {

    if (!Object.prototype.hasOwnProperty.call(OrientationLockType, 'orientation')) { //this should be without the quotes

        var err = new Error();

        err.name = 'NotSupportedError';

        reject(err); // "cannot change orientation");

    } else {

        screenOrientation.setOrientation(orientation);

        resolve('Orientation set'); // orientation change successful

    }

}

Champion
Rank: #363
Solution

This fix has now been applied to the github project, so the master branch is ready to be used again.