Skip to content

window.orientation was changed to string #3884

@chocolatechipui

Description

@chocolatechipui

On iOS 7, 8 and 9 window.orientation is a number:

typeof window.orientation === 'number' // returns true;

But in TypeScript 1.5 you've changed the type of window.orientation to string. This makes it impossible to check for orientation on iOS, such as the following:

var landscape = (window.orientation === 90 || window.orientation === -90);

TypeScript complains that you can't compare a number to a string. On iOS this is always a number.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions