Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

screen-orientation.change events should be cancellable #92

Closed
purplecabbage opened this issue Jul 15, 2016 · 1 comment
Closed

screen-orientation.change events should be cancellable #92

purplecabbage opened this issue Jul 15, 2016 · 1 comment

Comments

@purplecabbage
Copy link

userland code should be given the chance to ignore the event and prevent the orientation from changing.

function onOrientationChange(evt) {
    if(evt.target.type !== 'landscape-primary') {
        evt.preventDefault();
    }
}
@marcoscaceres
Copy link
Member

These report after the orientation has already changed, not before... so default can't be prevented.

To prevent the default, one uses the API to lock the orientation to what your app needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants