Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 11 Compatibility #13

Open
MobilityTiago opened this issue Jan 5, 2018 · 2 comments
Open

iOS 11 Compatibility #13

MobilityTiago opened this issue Jan 5, 2018 · 2 comments

Comments

@MobilityTiago
Copy link

Seems that in iOS11 keyboard will appear/disappear notifications are no longer triggered while navigating fields (i.e. up/down arrows on accessory view), this makes navigating between a field with a decimal keyboard and one that needs the decimal button added not work properly.

I'm checking on a fix for the project I'm in where I'll expose a function to be called on the focus of fields when this plugin is used in iOS11 or above.

@mesqueeb
Copy link

Dear @MobilityTiago Did you solve this issue?

I have two inputs in a form whereby one needs the decimal keyboard and the other the regular keyboard. I think I'll hit the same problem as you!

@MobilityTiago
Copy link
Author

@mesqueeb in my fork of this repository I have added two functions with add/remove decimal character to be called on the focus/blur of the decimal fields.

I haven't synced in a while with this repository so be aware that you may not be able to just switch to my fork (it has some other minor differences because I needed to adapt it to our project).

Please check it out:
https://github.com/MobilidadeBPI/cordova-plugin-decimal-keyboard

decimal-keyboard.js

DecimalKeyboard.addDecimalToKeyboard = function(successCallback, errorCallback){
    exec(successCallback, errorCallback, "DecimalKeyboard", "addDecimalToKeyboard", []);
};
               
DecimalKeyboard.removeDecimalFromKeyboard = function(successCallback, errorCallback){
    exec(successCallback, errorCallback, "DecimalKeyboard", "removeDecimalFromKeyboard", []);
};

CDVDecimalKeyboard.m

- (void) addDecimalToKeyboard:(CDVInvokedUrlCommand*)command {
    if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11"))
    {
        [self processKeyboardShownEvent];
    }
    
}

- (void) removeDecimalFromKeyboard:(CDVInvokedUrlCommand*)command {
    if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11"))
    {
        if(decimalButton)
            [self removeDecimalButton];
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants