ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Ionic select box can "double-pop" on select. Does not accept input after

Open AlexChesser opened this issue 10 years ago • 22 comments

Note: If you are having problems formatting your issue please refer to this article on using markdown in Github:

https://guides.github.com/features/mastering-markdown/

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/ http://ionicworldwide.herokuapp.com/

Short description of the problem:

A select box within ionic on an android device will sometimes "double-pop" on select. The select overlay will then NOT receive input from the user.

What behavior are you expecting?

A select box on touch should POP the list ONCE The selected option from the list should update the dropdown value

Steps to reproduce:

  1. RUN code in the repository https://github.com/AlexChesser/ionic-select-double-pop on an android list.
  2. follow the behavior in the youtube video https://www.youtube.com/watch?v=pNQ3OGCQRHg specifically, TAP a TEXT BOX, THEN Select Box in rapid succession until you witness the double pop

Ionic select double pop bug

https://github.com/AlexChesser/ionic-select-double-pop

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

My thoughts are that this is LIKELY related to the NG-CHANGE event on the select or an interaction with this and the NG-BLUR on the text input.

Which Ionic Version? 1.x or 2.x

1.x

Plunker that shows an example of your issue

As this happens on device only I've created a repo in github

https://github.com/AlexChesser/ionic-select-double-pop https://www.youtube.com/watch?v=pNQ3OGCQRHg

Run ionic info from terminal/cmd prompt: (paste output below)

PS C:\www\test\ionic-select-double-pop> ionic info

Your system information:

Cordova CLI: 5.4.1
Gulp version:  CLI version 3.9.0
Gulp local:
Ionic Version: 1.3.0
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Windows 7 SP1
Node Version: v4.2.2

AlexChesser avatar May 10 '16 20:05 AlexChesser

Hi, i'm facing the same bug on iOS. System information:

Cordova CLI: 6.0.0 Gulp version: CLI version 1.2.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 1.3.0 Ionic CLI Version: 2.0.0-beta.25 Ionic App Lib Version: 2.0.0-beta.15 ios-deploy version: Not installed ios-sim version: 5.0.6 OS: Mac OS X El Capitan Node Version: v5.11.0 Xcode version: Xcode 7.3 Build version 7D175

felipelvira avatar May 17 '16 17:05 felipelvira

One thing I've found @felipelvira is that the incidence of occurrence greatly reduced then I eliminated ng-model from the input element (while leaving ng-model on the select)

In order to make sure I still got the behaviour I needed in the APP I changed the logic of the ng-blur to also set the variable I needed in the background.

I think the problem could exist at the ionic or the angular level, but no longer think it might be at the cordova or operating-system level - dropdown list functionality generally appears to work this way everywhere without issue.

It might be related to too many watches on the page, too many background updates messing with things. Something like that, but anyways as I said, for me, removing an ng-model from the input element fixed things.

AlexChesser avatar May 17 '16 17:05 AlexChesser

Hi I have the same issue I created this stackoverflow post. As far as I can tell it is due to the events with ng-untouched being replaced with ng-touched since after it has been replaced the select works fine

herman1vdb avatar May 19 '16 09:05 herman1vdb

Hi!

We have a few app with a solid daily user base and we encountered the same issue. This simply break all of our apps where both a text input and select is present. So this is high priority to solve for us and we have started to look into the issue, I will post our results here.

NoNameProvided avatar May 20 '16 14:05 NoNameProvided

Hi

we are facing the same issue. The issue occured without any changes made to our app before. Could the problem be related to an Android update e. g. the System Web View?

mafeltes avatar May 20 '16 14:05 mafeltes

Hi @mafeltes

I had came up with the same idea, I just have tested our test app created for this bug with crosswalk instead of the included webview. It seems to work with Crosswalk 18.48.477.13 (based on Chromium 48)

It is a big improvement (I will test our real apps now) but I don't think it's related only to the Chrome webview because @felipelvira experienced the same issue with iOS (no Chrome webview there). I wouldn't exclude the idea from further conversation tho. It could be the reason. I start digging, hopefully will find the full solution during the weekend.

NoNameProvided avatar May 20 '16 14:05 NoNameProvided

You can install Crosswalk into your projects with

cordova plugin add cordova-plugin-crosswalk-webview

Please note that the Android Support Repository must be present to build the app with Crosswalk (could be downloaded through the SDK manager in the Extra section.)

NoNameProvided avatar May 20 '16 14:05 NoNameProvided

Btw I am surprised about the inactivity of the creators of Ionic, because this bug literally kills all android Ionic app which use the chrome webview even those which was deployed before the bug.

NoNameProvided avatar May 20 '16 14:05 NoNameProvided

Hello @NoNameProvided ! Sorry for the delay on this. After some preliminary testing on my part im starting to think this is an angularjs issue and not an ionic issue. Would you mind testing with just a plain Angularjs app ? Again, very sorry for the delay on this, thats totally my fault and i apologize.

jgw96 avatar May 20 '16 16:05 jgw96

Hi @jgw96

I think you're right, it's not an ionic issue. If I browse (with my android phone) to a site that uses angularjs it does exactly the same. As I have explained in my stackoverflow post (mentioned earlier). It works with ionic serve though (desktop browser). However it could be related to the changes Angular does that interferes with Android's select.

I've got a work around here.

Thanks & Regards

herman1vdb avatar May 23 '16 05:05 herman1vdb

We did a little investigation on Friday (sadly didn't make too much progress), I have no more dedicated time to investigate today. I attach a very simple example debugging app to show the issue.

test-app.zip

To set up on mac simply call:

npm install
make setup-cordova 
make android

(If you are on windows check the makefile to see what commands it runs.)

After launching the app you can see the buggy behaviour (touch input, then touch the selectbox and see it flashes twice and unresponsive to input.)

Changing the lines in index.es6 to this will solve the issue

//import 'ionic-sdk/release/js/ionic.js';
//import 'ionic-sdk/release/js/ionic-angular.js';

// ... 

// Bootstrap with Ionic (it's broken)
//let mod = angular.module('myApp', [ 'ionic' ]);

// Bootstrap without Ionic (it works)
let mod = angular.module('myApp', [  ]);

So it works with angular only and ionic cause the problem. What is more leaving ionic js included but commenting out the ionic scss file entry point will solve the issue as well. (in style.scss) This one is pretty weird behaviour. Maybe Ionic interfere with the angular classes?

I think the root of the problem is that Angular call an apply during the opening of the selectbox, because the blur event on the text input will trigger a change from untouched to touched. This happens only the first time, after the second touch, apply wont be called when the input lose its focus, and things works as expected.

Could it maybe related to the events triggered by Ionic? I am not familiar with the internal moving of Angular or Ionic, but Ionic trigger events its own way to handle touch, this could lead to the issue.

But as I mentioned It works with the latest crosswalk plugin, so it could be an issue wit the webview itself? (I think this is not so possible, but the fact that any ionic app downloaded from the market have this issue, means that something had to change in the webview as well.) Our case was the same, we haven't updated angular or Ionic, it just stopped working, so the only thing what could have changed is the webview.

NoNameProvided avatar May 23 '16 09:05 NoNameProvided

However it could be related to the changes Angular does that interferes with Android's select.

@hemantgogia09 Could you share your testing setup? It works for me with pure Angular and Android. Maybe I am missing some point?

After some preliminary testing on my part im starting to think this is an angularjs issue and not an ionic issue.

@jgw96 Could you share your method as well? I have not much knowledge of the mechanics of under the hood of Ionic. So it would help if you could share your thoughts behind your insights.

NoNameProvided avatar May 23 '16 09:05 NoNameProvided

@NoNameProvided We've done some testing ourselves, turned out not to be WebView it's something else maybe the OS could play a roll or the keyboard... not all devices does this so can't be easily recreated.. All I can share have been shared on stackoverflow post with a workaround... sorry that's all I've got.

herman1vdb avatar May 23 '16 09:05 herman1vdb

You provided wrong name @NoNameProvided but right person has answered.

hemantgogia09 avatar May 23 '16 09:05 hemantgogia09

@hemantgogia09 Ohh, sorry man! :)

NoNameProvided avatar May 23 '16 09:05 NoNameProvided

@NoNameProvided I am simply testing with the repo that was given by the op. Im having trouble reproducing this on my devices (Nexus 6 running the Android N dev preview, Nexus 7 running Anrdroid 6.0.1 and a Moto X 2014 running Android 5.1.1) unfortunately. I seem to have only been able to repro once, but it may have been user error on my part. What devices and Android versions have you all been able to repro on so far ? And is everyone's system webview up to date (if your on a new enough version of android to actually be able to update that)? Thanks everyone!

jgw96 avatar May 23 '16 15:05 jgw96

Hello all! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!

jgw96 avatar May 28 '16 18:05 jgw96

@jw96 - did you try with the repository I posted https://github.com/AlexChesser/ionic-select-double-pop ?

That one wasn't as reliably reproducable as the actual program I'd written, which was 100% I think the difference between the two as that I was firing an encryption task on blur (more processing on device)

Have made this happen on a samsung S5, S6 and nexus 5. Android versions 5.1 & 6.0.1

If there have been no fixes, I'm not sure it is appropriate to close the ticket, better perhaps to "put it down for a while" and come back to it with the understanding that it is hard.

The bug hasn't gone away, has it?

AlexChesser avatar May 30 '16 13:05 AlexChesser

Hi all!

This issue is not present on the 13 June 2016 Android System webview update. Hope it won't come back.

NoNameProvided avatar Jun 15 '16 12:06 NoNameProvided

Still happening both on Android & iOS.

luco avatar Sep 21 '16 12:09 luco