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

Colon displayed on keyboard, but not allowed #197

Closed
brenzosa opened this issue Aug 12, 2013 · 1 comment
Closed

Colon displayed on keyboard, but not allowed #197

brenzosa opened this issue Aug 12, 2013 · 1 comment
Labels

Comments

@brenzosa
Copy link

The following properly displayed a keyboard with a colon as the first button on the fourth row:

// keyboard
row.find("input").keyboard({ 
    layout: 'custom',
    maxLength : 8,
    restrictInput : true,
    useCombos : false,
    position : {
            of : null,
            my : 'left top',
            at : 'left top',
            at2: 'left top' 
    },
    customLayout: { 
        'default' : [ 
        '7 8 9 {bksp}', 
        '4 5 6 {a}', 
        '1 2 3 {c}', 
        ': 0 00']
    }
})

However, clicking the colon button, pasting text with a colon, or typing in a colon was not allowed. To work around the problem, I had to change this:

// regular button (not an action key)
base.acceptedKeys.push(keys[key].split(':')[0]);
base.addKey(keys[key], keys[key], true);

...to this:

// regular button (not an action key)
if (keys[key] == ':') {
    base.acceptedKeys.push(':');
} else {
    base.acceptedKeys.push(keys[key].split(':')[0]);
}
base.addKey(keys[key], keys[key], true);
@Mottie
Copy link
Owner

Mottie commented Oct 3, 2013

Hi @brenzosa!

Sorry for taking so long to respond, but thanks for reporting this issue! I'll have it fixed in the next update.

@Mottie Mottie closed this as completed in 045ec84 Oct 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants