Skip to content

Colon displayed on keyboard, but not allowed #197

@brenzosa

Description

@brenzosa

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); 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions