yairEO / tagify

🔖 lightweight, efficient Tags input component in Vanilla JS / React / Angular / Vue
https://yaireo.github.io/tagify/
Other
3.5k stars 430 forks source link

Unable to set tags as Read-Only with Vue Tagify #674

Closed jetacpp closed 3 years ago

jetacpp commented 3 years ago

I followed the documentation and tried all of following settings, however the tags remained editable. The issue can be reproduced on Vue Demo page.

<Tags v-bind:settings="tagifySettings" initialValue='[{"value":"foo", "editable":false}, {"value":"bar"}]' :onChange="onTagsChange"/>

this.suggestions = [
        { value: "ironman", code: "im", editable: false },
        { value: "antman", code: "am", editable: false },
        { value: "captain america", code: "ca", editable: false },
        { value: "thor", code: "th" , editable: false},
        { value: "spiderman", code: "sm", editable: true }
      ];
tagifySettings: {
        whitelist: [],
        callbacks: {
          add(e) {
            console.log("tag added:", e.detail);
          },
        },
        autoComplete: {
            enabled: true,
            rightKey: true
        },
        editTags: null
      },
yairEO commented 3 years ago

I will fix it.

In the meanwhile, you can create your own Tagify Vue component and do whatever you wish there, it's just a super simple component, you don't have to use the one here

yairEO commented 3 years ago

But why are you unable? I don't see anywhere in the posted code that you've even tried setting it to readonly...

<Tags readonly :settings=...