Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Phone 8.1 cordova dropdown not working

I have a cordova based app that behaves differently on two very similar Windows Lumia phones. The selects (aka dropdowns) don't function on the newer phone.

The phone they DON'T work on is this one:

Lumia Denim 640 LTE
OS, 8.1, Update 2
Application Version, 3.15.4.28
Manufacturer Name, RM-1073_1001
Carrier, T-Mobile

The phone they DO work on is this one:

Lumia Cyan 520
OS 8.1
"Application Version", 3.15.4.28
Manufacturer Name, RM-915_nam_usa_228
Carrier, AT&T

When I run the app from Visual Studio directly to the device there are no errors in the console.

When the app initializes, the selects get bound, by design, to a json object using jsRender and jsViews.

The same app runs fine on iOS and Android.

I don't want to use WinJs controls.

Ideas?

like image 348
pdschuller Avatar asked Oct 18 '22 18:10

pdschuller


2 Answers

Please make sure you are not using the Fastclick library, which will disable <select> on Windows Phone. So if you use that library, please comment out that usage.

like image 155
sirius2013 Avatar answered Jan 04 '23 06:01

sirius2013


In fact, the phones are very similar, but there are an important detail. Lumia 640 has a FWVGA screen (1280x720). It could cause design problems on Windows Phone cordova Apps (happened to me).

To solve it, I implemented the following code in C# at Cordova Project MainFile:

public MainPage()
{
    InitializeComponent();
    this.CordovaView.Loaded += CordovaView_Loaded;

    //Adjusting Cordova View for New Lumias pixel ratio
    this.CordovaView.Margin = new Thickness(0, 0, 0, -90);
    this.CordovaView.Padding = new Thickness(0, 0, 0, -90);
}

In my case, it helped to solve a problem with a fixed header menu. You could work around this information.

like image 40
Cordovaing Avatar answered Jan 04 '23 06:01

Cordovaing