M. Javad Mohebbi
M. Javad Mohebbi

Reputation: 425

Comma is not working with Bootstrap TagsInput and Bootstrap Typeahead

I am going to use Bootstrap TagsInput and Bootstrap Typeahead in one of my project.

When I start typing, Typeahead will show the suggestions. If I press [ENTER], It will add correctly. but there is a problem that when i type somthing and press [Comma button , ] it do nothing.

Here is my Input:

<input type="text" autocomplete="false" id="tags" name="tags">

JS Codes:

$('#tags').tagsinput({
            confirmKeys: [13, 188],
            typeahead : {
                afterSelect: function(val) { this.$element.val(""); },
                displayKey: 'text',
                valueKey: 'value',
                source: [
                    { "value":"test1", "text":"test1" },
                    { "value":"test2", "text":"test2" }
                ]
            },
            freeInput: true,
            itemValue: 'value',
            itemText: 'text',

        });

Upvotes: 2

Views: 1307

Answers (1)

James Corr
James Corr

Reputation: 81

change: confirmKeys: [13, 188],

to: confirmKeys: [13, 44],

Upvotes: 3

Related Questions