Problem
setting 'formFactor' attribute, does not always generate the intended behavior
Steps to reproduce
(code taken from "advanced/device_query", modifying formFactor attributes for the handheld devices)
"#osLabel": {
text: "Generic"
},
"#osLabel[platform=ios]": {
text: "iOS device\n(size unknown)"
},
"#osLabel[platform=ios formFactor=tablet]": {
text: "iPad"
},
"#osLabel[platform=ios formFactor=foo]": {
text: "iPhone"
},
"#osLabel[platform=android formFactor=bar]": {
text: "AndroidPhone",
color: "#000"
},
"#osLabel[platform=android formFactor=tablet]": {
text: "AndroidTablet",
color: "#000"
},
Results:
. iPhone: always displaying 'iPhone' text, also when setting anything as 'formFactor' and different than 'tablet'
. iPad: works fine, displaying 'iPad' text only when setting 'tablet' word as 'formFactor'
. Android Phone and Tablets: Always displaying the text associated to the Conditional Code part if a 'formFactor' attribute is set with any value. However, if only 'formFactor=tablet' is specified (commenting out the 'formFactor=bar' part), the condition is not satisfied and the 'Generic' text is displayed, even on tablets.
i.e. in the sample code, run on tablet devices, 'Android' text is always displayed instead of 'Android\nTablet'
I don't think it's worth inspecting the unexpected behavior of misusing the formFactor attribute in device queries personally. Does it ever actually fail when used properly? Do we really need to dig into this one as it is documented?
When used properly (i.e. using the original 'advanced/device_query' Sample code), it fails for Android Tablets, always detected just as 'Android'. Not been able to correctly detect Android Tablet.
I can't reproduce the issue with the advanced/device_query app. Just tested on emulator against 2 separate android tablets and they both show the styles for android tablet. Any more details on how you ran this or can i close the ticket?
This is caused by the same issue in ALOY-497
Verified as fixed with the latest 1_0_X version (Git commit b97ead593b6e7c2b2a3beae4cb9a8720dd3931b6) All JS files are regenerated on each build.