mbenford / ngTagsInput

Tags input directive for AngularJS
http://mbenford.github.io/ngTagsInput
MIT License
1.64k stars 541 forks source link

Disable remove option ? #358

Closed rawoke083 closed 9 years ago

rawoke083 commented 9 years ago

HI is there a way to disable removal of tags (via button and key) ? PS. Nice project :)

quzma commented 9 years ago

+1

mbenford commented 9 years ago

Sorry for not replying sooner.

Currently there's no such feature available. I fail to see how that would be useful, though. I mean, how would the user remove a tag added by mistake? It's like having an input element with the backspace key disabled; you would have to perfectly enter the text because you wouldn't be able to correct any mistake.

quzma commented 9 years ago

For me use case was to remove backspace binding since it has other used in the app.

mbenford commented 9 years ago

@rawoke083 v2.3.0 will introduce a new callback called onTagRemoving that can be used to prevent a tag from being removed. So I think you'll be able to achieve what you want.

Can this issue be closed?

rawoke083 commented 9 years ago

Yup ! On 14 Mar 2015 6:05 PM, "Michael Benford" notifications@github.com wrote:

@rawoke083 https://github.com/rawoke083 v2.3.0 will introduce a new callback called onTagRemoving that can be used to prevent a tag from being removed. So I think you'll be able to achieve what you want.

Can this issue be closed?

— Reply to this email directly or view it on GitHub https://github.com/mbenford/ngTagsInput/issues/358#issuecomment-80553508 .

sibelius commented 8 years ago

I have an use case for this:

breadcumb

Image if I want to create a hierarchical structure based on the previous tags, like Brazil / São Paulo / São Carlos - to select a region.

I would like to disable, hide or remove the remove button, so the user should only return the last tag added