Prevent hiding keyboard on Android back button


I have a text input which shows the keyboard when focused.
Can someone offer advice on how to prevent the keyboard from hiding when the Android back button is hit?

I have the following code:

    $ionicPlatform.registerBackButtonAction(function () {
    }, 100);

I’ve tried a constant-focus directive as shown here: but this doesn’t seem to do anything.


I believe the “back” button actually becomes a “hide keyboard” button when the keyboard is displayed – I don’t know how you’d keep that from happening, though.

But I’m thinking that my function should have higher priority - if i change the 100 to say 9999 it still doesn’t work…