Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8773

iOS Keyboard doesn't open when Prompt dialog displayed

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • cordova-plugin-dialogs
    • None
    • iOS

    Description

      When you call navigator.notification.prompt the prompt displays but the keyboard does not automatically display. You have to tap the input to display the keyboard.

      Attachments

        Issue Links

          Activity

            sean-hill Sean Hill created issue -
            githubbot ASF GitHub Bot added a comment -

            GitHub user cjpearson opened a pull request:

            https://github.com/apache/cordova-plugin-dialogs/pull/50

            CB-8773: Fix for iOS 8 keyboard not appearing on prompt

            You can merge this pull request into a Git repository by running:

            $ git pull https://github.com/cjpearson/cordova-plugin-dialogs CB-8773

            Alternatively you can review and apply these changes as the patch at:

            https://github.com/apache/cordova-plugin-dialogs/pull/50.patch

            To close this pull request, make a commit to your master/trunk branch
            with (at least) the following in the commit message:

            This closes #50


            commit 9570b1fa457a284923f1db80a088d638053acf6c
            Author: Connor Pearson <cjp822@gmail.com>
            Date: 2015-04-02T00:12:11Z

            CB-8773: Fix for iOS 8 keyboard not appearing on prompt


            githubbot ASF GitHub Bot added a comment - GitHub user cjpearson opened a pull request: https://github.com/apache/cordova-plugin-dialogs/pull/50 CB-8773 : Fix for iOS 8 keyboard not appearing on prompt You can merge this pull request into a Git repository by running: $ git pull https://github.com/cjpearson/cordova-plugin-dialogs CB-8773 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-dialogs/pull/50.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #50 commit 9570b1fa457a284923f1db80a088d638053acf6c Author: Connor Pearson <cjp822@gmail.com> Date: 2015-04-02T00:12:11Z CB-8773 : Fix for iOS 8 keyboard not appearing on prompt
            githubbot ASF GitHub Bot added a comment -

            Github user sean-hill commented on the pull request:

            https://github.com/apache/cordova-plugin-dialogs/pull/50#issuecomment-89077944

            :+1:

            githubbot ASF GitHub Bot added a comment - Github user sean-hill commented on the pull request: https://github.com/apache/cordova-plugin-dialogs/pull/50#issuecomment-89077944 :+1:
            Kindberg Jacob Kindberg added a comment -

            Cool, will this fix come into the next dialogs release?

            It is also an issue on Android. Is that better suited for separate issue?

            Kindberg Jacob Kindberg added a comment - Cool, will this fix come into the next dialogs release? It is also an issue on Android. Is that better suited for separate issue?
            shazron Shazron Abdullah made changes -
            Field Original Value New Value
            Component/s Plugin Dialogs [ 12320642 ]
            Component/s iOS [ 12316400 ]
            Environment iOS
            jcesarmobile jcesarmobile added a comment - - edited

            Can you give more details? (device, os version, code you used, etc)

            I can't reproduce the bug on an iPhone 5 with iOS 8.1.3

            Code used to test:

            navigator.notification.prompt("message", function(data){console.log(data.input1);},"title", ["ok","cancel"], "default text");
            
            jcesarmobile jcesarmobile added a comment - - edited Can you give more details? (device, os version, code you used, etc) I can't reproduce the bug on an iPhone 5 with iOS 8.1.3 Code used to test: navigator.notification.prompt( "message" , function (data){console.log(data.input1);}, "title" , [ "ok" , "cancel" ], " default text" );
            Kindberg Jacob Kindberg added a comment - - edited

            I have testet it on an iPhone 5 iOS 8.3 (also had the issue on version 8.1.3). I also testet it on a Nexus 5, android 4.4.2, where the issue is also present.

            Using dialogs plugin version 0.3.0, cordova version 4.2.0

            I used the following code to test:

            navigator.notification.prompt( "What is your name?", function(results){
            		if(results.buttonIndex == 1){
            			console.log(results.input1);	
            		}
            }, "Please type in your name");
            
            Kindberg Jacob Kindberg added a comment - - edited I have testet it on an iPhone 5 iOS 8.3 (also had the issue on version 8.1.3). I also testet it on a Nexus 5, android 4.4.2, where the issue is also present. Using dialogs plugin version 0.3.0, cordova version 4.2.0 I used the following code to test: navigator.notification.prompt( "What is your name?" , function(results){ if (results.buttonIndex == 1){ console.log(results.input1); } }, "Please type in your name" );
            cjpearson Connor Pearson added a comment -

            It might be device specific. I've been able to reproduce this on an iPad 3 on 8.0. Using the simulator I could reproduce it on an iPhone 6, but not a 5s. Both on 8.1.

            cjpearson Connor Pearson added a comment - It might be device specific. I've been able to reproduce this on an iPad 3 on 8.0. Using the simulator I could reproduce it on an iPhone 6, but not a 5s. Both on 8.1.

            Commit 45850406a3115c788ab513d26d8be94cf0e63d9e in cordova-plugin-dialogs's branch refs/heads/master from cjpearson
            [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-dialogs.git;h=4585040 ]

            CB-8773: Fix for iOS 8 keyboard not appearing on prompt

            This closes #50

            jira-bot ASF subversion and git services added a comment - Commit 45850406a3115c788ab513d26d8be94cf0e63d9e in cordova-plugin-dialogs's branch refs/heads/master from cjpearson [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-dialogs.git;h=4585040 ] CB-8773 : Fix for iOS 8 keyboard not appearing on prompt This closes #50
            githubbot ASF GitHub Bot made changes -
            Remote Link This issue links to "GitHub Pull Request #50 (Web Link)" [ 55636 ]
            githubbot ASF GitHub Bot added a comment -

            Github user asfgit closed the pull request at:

            https://github.com/apache/cordova-plugin-dialogs/pull/50

            githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/cordova-plugin-dialogs/pull/50
            jcesarmobile jcesarmobile added a comment -

            Fixed in 1.2.2-dev

            jcesarmobile jcesarmobile added a comment - Fixed in 1.2.2-dev
            jcesarmobile jcesarmobile made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            githubbot ASF GitHub Bot made changes -
            Remote Link This issue links to "GitHub Pull Request #50 (Web Link)" [ 55636 ] This issue links to "GitHub Pull Request #50 (Web Link)" [ 55636 ]
            githubbot ASF GitHub Bot added a comment -

            Github user dirkpostma commented on the issue:

            https://github.com/apache/cordova-plugin-dialogs/pull/50

            I still suffer from keyboard not appearing on prompt, this fix doesn't seem to work for me.
            I tried to debug, but couldn't find the cause. I tried setting a breakpoint in didPresentAlertView in file CDVNotification.m, but the method is never executed.

            More info:

            iPhone 7
            iOS 10.2
            cordova-plugin-dialogs 1.3.1
            Cordova CLI: 6.3.1
            OS: Mac OS X El Capitan
            Node Version: v5.0.0
            Xcode version: Xcode 8.2.1 Build version 8C1002

            githubbot ASF GitHub Bot added a comment - Github user dirkpostma commented on the issue: https://github.com/apache/cordova-plugin-dialogs/pull/50 I still suffer from keyboard not appearing on prompt, this fix doesn't seem to work for me. I tried to debug, but couldn't find the cause. I tried setting a breakpoint in didPresentAlertView in file CDVNotification.m, but the method is never executed. More info: iPhone 7 iOS 10.2 cordova-plugin-dialogs 1.3.1 Cordova CLI: 6.3.1 OS: Mac OS X El Capitan Node Version: v5.0.0 Xcode version: Xcode 8.2.1 Build version 8C1002
            githubbot ASF GitHub Bot made changes -
            Remote Link This issue links to "GitHub Pull Request #50 (Web Link)" [ 55636 ] This issue links to "GitHub Pull Request #50 (Web Link)" [ 55636 ]
            githubbot ASF GitHub Bot added a comment -

            Github user dirkpostma commented on the issue:

            https://github.com/apache/cordova-plugin-dialogs/pull/50

            For ionic users who suffer the same problem, I found a workaround by applying a 500ms timeout.
            It's bad UX because of the delay, but at least the keyboard is not dismissed anymore.

            > function promptIOS(message, title, value) {
            > return $timeout(function() {
            > return $cordovaDialogs.prompt(_.defaults(message, ""), _.defaults(title, "Type een omschrijving"), ['Cancel', 'OK'], value)
            > .then(function(result) {
            > var input = result.input1;
            > // no button = 0, 'Cancel' = 1, 'OK' = 2
            > var buttonIndex = result.buttonIndex;
            >
            > if (buttonIndex == 2)

            { > // OK pressed > return $q.resolve(result.input1); > }

            else

            { > // Cancel > return $q.reject("user pressed cancel"); > }

            > });
            > }, 500);
            > }

            githubbot ASF GitHub Bot added a comment - Github user dirkpostma commented on the issue: https://github.com/apache/cordova-plugin-dialogs/pull/50 For ionic users who suffer the same problem, I found a workaround by applying a 500ms timeout. It's bad UX because of the delay, but at least the keyboard is not dismissed anymore. > function promptIOS(message, title, value) { > return $timeout(function() { > return $cordovaDialogs.prompt(_.defaults(message, ""), _.defaults(title, "Type een omschrijving"), ['Cancel', 'OK'] , value) > .then(function(result) { > var input = result.input1; > // no button = 0, 'Cancel' = 1, 'OK' = 2 > var buttonIndex = result.buttonIndex; > > if (buttonIndex == 2) { > // OK pressed > return $q.resolve(result.input1); > } else { > // Cancel > return $q.reject("user pressed cancel"); > } > }); > }, 500); > }
            shazron Shazron Abdullah made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            iroh Chris Wells made changes -
            Workflow classic default workflow [ 12942188 ] Classic - editable closed [ 14077386 ]
            iroh Chris Wells made changes -
            Workflow Classic - editable closed [ 14077386 ] classic default workflow [ 14085938 ]

            People

              Unassigned Unassigned
              sean-hill Sean Hill
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: