question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tapping ion-checkbox brings up keyboard on Android < 4.4

See original GitHub issue

i am using the latest ionic build, but i am struggling with the keyboard (at least on android). i got an input field where you can enter a number:

<input type="number" blur-keyboard>

now when i enter it, the keyboard shows up as expected. when i hit “go”, it disappears, but leaves the blue input cursor of android in the input field. now when i click on any other part of the app (for example, i got a checkbox right after the input field), the keyboard pops up again. i started writing a directive (“blur-keyboard”) to hide the keyboard manually, but i don´t know how to to that:

.directive('blurKeyboard', function() {
    return function ($scope, $element, $attrs) {
        $element.bind('blur', function () {
            //TODO hide keyboard
        });
    };
})

is this a known issue? it´s a major problem, obviously. i can provide screenshots if my explanation is not understandable.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tlancinacommented, Apr 16, 2015

This appears to be an issue with ion-checkbox. For various reasons, the checkbox itself isn’t styled, it’s hidden and instead a checkbox icon is styled whenever you click on the surrounding label.

Interestingly enough on Android < 4.4 if the checkbox has display: none or visibility: hidden you get the behavior you described. Also on iOS I noticed that tapping an ion-checkbox while the keyboard is open doesn’t close the keyboard, although it should.

I’m not sure of a good fix that won’t possibly break other things (namely #496), but you can try this CSS hack for your case in the meantime:

.checkbox.checkbox-input-hidden input {
  display: block !important;
  position: absolute;
}

So instead of hiding the checkbox it will simply be behind the icon, but still technically visible. Unfortunately you’ll now sometimes see the light blue Android highlight color when tapping the checkbox, but the keyboard should remain closed.

0reactions
tlancinacommented, Jun 8, 2015

Not much we can do for this, the recommendation is to use Crosswalk for older Android devices.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tapping ion-checkbox brings up keyboard on Android < 4.4
i am using the latest ionic build, but i am struggling with the keyboard (at least on android). i got an input field...
Read more >
Get the Android 4.4 KitKat-Style Keyboard on Your ... - YouTube
... Keyboard for AndroidFull Tutorial: http://galaxy-note-3.wonderhowto.com/how-to/get-new- kitkat -style- keyboard -your-samsung-galaxy-no...
Read more >
ionic-v1.x - Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Ionic Forum - Latest topics - RSSing.com
I keep getting this error whenever I ionic build android --prod. it works fine ... Now when I tap on any field keyboard...
Read more >
sitemap-questions-171.xml - Stack Overflow
... https://stackoverflow.com/questions/5839273/android-keyboard-hides-itself- ... start-an-intent-android-pops-up-a-complete-action-using-dialog 2018-10-26 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found