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

AlertController button click selects element behind the button

Open RobinVerheijen opened this issue 9 years ago • 8 comments

Ionic version: (check one with "x") [ ] 1.x [x ] 2.x

I'm submitting a ... (check one with "x") [x ] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior: When tapping a button in an alert the alert dismisses but the element behind the button also gets tapped. For example when a textfield is behind the button it gets selected and the keyboard shows.

Expected behavior: Expecting the alert to be closed and nothing else to happen.

Steps to reproduce: To reproduce you need to test it on a device, I've tested in on an iOS device.

Can't provide an example sadly. Simply create some inputs, create an alert and see what happens.

Other information: At first I thought it could be a CSS issue, so I tried removing the pointer-events from the backdrop and any other alert elements (not the buttons obviously). Didn't work...

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Cordova CLI: 6.4.0 Ionic Framework Version: 2.0.0-rc.4 Ionic CLI Version: 2.1.18 Ionic App Lib Version: 2.1.9 Ionic App Scripts Version: 0.0.47 ios-deploy version: 1.9.0 ios-sim version: 5.0.11 OS: macOS Sierra Node Version: v6.9.1 Xcode version: Xcode 8.2.1 Build version 8C1002

RobinVerheijen avatar Jan 05 '17 08:01 RobinVerheijen

Hello, thanks for opening an issue with us! I am taking a look at this issue now. Does this only happen on iOS or on Android too? Also, are you using our fork of the wkwebview cordova plugin ?

jgw96 avatar Jan 05 '17 17:01 jgw96

I can only test on iOS, so I can't tell if it's also happening on Android.

I'm not using the fork, should I?

** Update! ** The WKWebView seems to have fixed the issue! Thanks for the suggestion!

RobinVerheijen avatar Jan 05 '17 17:01 RobinVerheijen

Hey @RobinVerheijen , glad wkwebview fixed it for you. I just tested this on uiwebview on iOS 10 and i was not able to reproduce this. Would you be able to provide a repo that i could use to reproduce? Thanks!

jgw96 avatar Jan 05 '17 20:01 jgw96

Sure I can, perhaps it's easier if you see it in action: link to video.

I've also created a repo here. I've generated an Ionic 2 project, added some inputs and an alert. You can see the result in the video.

Thanks again for the help, if you find anything please let me know!

RobinVerheijen avatar Jan 05 '17 23:01 RobinVerheijen

Thanks for the repo, i can now reproduce this! So this seems to be specific to inputs behind an alert, i cannot get it to happen with buttons behind an alert.

jgw96 avatar Jan 06 '17 15:01 jgw96

Yes, same behavior here. Very odd!

RobinVerheijen avatar Jan 06 '17 18:01 RobinVerheijen

Hello @RobinVerheijen , this has been fixed in the latest nightly. Since UiWebView has issues with click delays we had to extend our click block slightly for certain components (like the alert) for UiWebView. Good thing is that this does not really have any effect on webviews that do not have issues with click delay, like the webview in android > 5.0. Because this has been fixed I am going to close this issue for now. Thanks for using Ionic!

jgw96 avatar Jan 24 '17 15:01 jgw96

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 04 '18 13:09 ionitron-bot[bot]