shentao / vue-multiselect

Universal select/multiselect/tagging component for Vue.js
https://vue-multiselect.js.org/
MIT License
6.65k stars 990 forks source link

Disable already selected items #1397

Open jongbonga opened 3 years ago

jongbonga commented 3 years ago

How do I lock/disable selected items in Multiple tag mode? Just like hide-selected hide the items, I would like them to be visible but non-removable.

lehoaibaokg commented 2 years ago

Use option slot and set the custom style to the option you want, it will be like disabled.

pointer-events: none;
opacity: 0.6;
liutkin commented 1 month ago

@lehoaibaokg This only covers mouse events and won't prevent users from selecting options via keyboard arrow keys. Use undocumented $isDisabled: true on option object: https://github.com/shentao/vue-multiselect/issues/176#issuecomment-307638151