Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bug in ExtJS 6 tagfield

I created a fiddle, which demonstrates the bug. The problem is that the tagfield ignores minChars property - when you first focus on the field, you can see a request to the server, which should not happen. I did the same thing with the combobox and everything works good. This is my code:

    Ext.create("Ext.form.field.Tag", {
        renderTo: "test",
        minChars: 999, //ignored, even though is documented
        enableKeyEvents: true,
        displayField: "text",
        valueField: "id",
        queryMode: "remote",
        autocomplete: "off",
        fieldLabel: "tagfield",
        store: {
            autoLoad:false,
            fields:[{name:'id'},{name:'text'}],
            proxy:{
                type:'ajax',
                url:'getData.php'

            }

        }
    });

    Ext.create("Ext.form.field.ComboBox", {
        renderTo: "test2",
        minChars: 999,
        enableKeyEvents: true,
        displayField: "text",
        valueField: "id",
        queryMode: "remote",
        autocomplete: "off",
        fieldLabel: "combo",
        store: {
            autoLoad:false,
            fields:[{name:'id'},{name:'text'}],
            proxy:{
                type:'ajax',
                url:'getData.php'

            }

        }
    });

Please, pay attention to the fact that minChars in both combobox and tagfield is documented similarly ([1], [2]):

minChars : Number

The minimum number of characters the user must type before autocomplete and typeAhead activate.

So, how can I fix this bug?

like image 369
Jacobian Avatar asked Nov 09 '22 05:11

Jacobian


1 Answers

You need to set the triggerAction:'all' or triggerAction:'query' config option based on how your combo box should filter the results.

like image 101
Kutty Avatar answered Nov 14 '22 21:11

Kutty