Skip to content

ons.platform.isAndroid and ons.platform.isIOS take into account selected platform #2475

@emccorson

Description

@emccorson

Onsen UI Version: 2.10.3

The functions ons.platform.isAndroid and ons.platform.isIOS take into account any values set using ons.platform.select.

For example, if you are using iOS but have set the platform to android, ons.platform.isAndroid will return true.

// on iOS
ons.platform.isAndroid(); //false
ons.platform.select('android');
ons.platform.isAndroid(); //true

This seems like unexpected behaviour to me. Maybe we could have separate functions like ons.platform.isReallyAndroid and ons.platform.isReallyIOS, or change the behaviour of the existing functions to ignore selected platform.

Also the documentation at https://onsen.io/v2/api/js/ons.platform.html#methods-summary should mention that the selected platform is not ignored.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions