How to disable creating new tags with select2 v4.0?

后端 未结 4 1914
借酒劲吻你
借酒劲吻你 2020-12-30 23:52

I\'ve been trying out the new Select2 v4.0 which has a lot of improvements. I\'m mainly interested in the tags feature. I want to be able to search for tags via

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-31 00:35

    This should work - in the initialization of select2, try returning undefined from the createTag function like so:

    createTag: function(params) {
                    return undefined;
               }
    

提交回复
热议问题