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

后端 未结 4 1942
借酒劲吻你
借酒劲吻你 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:32

    I've been struggling with this as well, but got it working after a few hours.

    I had specified a few token seperators (because my visitors are allowed to create tags in a different spot in the website). Turns out the seperators are still applied even if the tags configuration is set to false.

    Solution: tags: false and do NOT add a value for tokenSeperators. Keep multiple: true.

提交回复
热议问题