Skip to content

Error in JS console when entering text #168

Description

@callumprentice

Hi! Great work and thank you for an excellent product.

I see an error in the JS console on OS X & Chrome 26.0.1410.65 when I enter text and press the Enter key in my keyboard (which I have set up to accept):

Uncaught TypeError: Object function (e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)} has no method 'replace' jquery.keyboard.js:698

I'm using this version of jQuery:

<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.10.2.min.js"></script>

and version Version 1.17.5 of jquery.keyboard.js

This is my code to add a keyboard to my page:

    $('#keyboard').keyboard({
        accepted: keyboardSearch,
        visible: function (e, keyboard, el) {
            keyboard.$preview.val('');
            searchHasFocus = true;
        },
        hidden: function (e, keyboard, el) {
            searchHasFocus = false;
        },
        display: {
            'bksp': "\u2190",
            'accept': 'enter',
            'default': 'ABC'
        },
        layout: 'custom',
        customLayout: {
            'default': [
                '1 2 3 4 5 6 7 8 9 0',
                'q w e r t y u i o p',
                'a s d f g h j k l {bksp}',
                'z x c v b n m , . \'',
                '{cancel} {space} {enter}'
                ]
        }
    });
    $.keyboard.keyaction.enter = function (base) {
        base.accept();
        $('form').submit();
    };

I haven't made a fiddle for this yet - but I can do if the error isn't obvious.

I was able to remove the error for me as per the code by adding
useCombos: false in my initialization.

Cheers.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions