1

I'm using ngx-chips with Angular 5 and cant figure it out how to stop/disable selection of added tags.

I saw in the docs that there is (onSelect) method and try to return false but it is not working. I also try to prevent event with (click), but this method is not available for ngx-chips.

Does anyone know how to stop the tag selection after the tag is added?

Kaloyan Stamatov
  • 3,894
  • 1
  • 20
  • 30

1 Answers1

0

You can use the readonly property on the tag to achieve what you want. Use the onItemAdded event from ngx-chips, and when the item is added, set the readonly property to true for the new tag.

See the docs regarding this here.

Here is a StackBlitz example.

ViqMontana
  • 5,090
  • 3
  • 19
  • 54
  • 1
    That is great, but I need the close X button to stay active. I want to disable the selection only. I can mute the css, but looking for better approach – Kaloyan Stamatov Sep 12 '19 at 10:56