Select2 dropdown allow new values by user when user types

前端 未结 3 1294
抹茶落季
抹茶落季 2021-02-09 14:44

The select2 component can be configured to accept new values, as ask in Select2 dropdown but allow new values by user?

And you can see it at: http://jsfiddle.net/pHSdP/

相关标签:
3条回答
  • 2021-02-09 15:27

    And to be able to submit multiple new choices together with the existing ones:

    select2({tags: true, selectOnBlur: true, multiple: true})
    
    0 讨论(0)
  • 2021-02-09 15:33

    I am using Select2 4.0.3 and had to add two options:

    tags: true,
    selectOnBlur: true,

    This worked for me

    0 讨论(0)
  • 2021-02-09 15:36

    Adding attribute selectOnBlur: true, seems to work for me.

    Edit: glad it worked for you as well!

    0 讨论(0)
提交回复
热议问题