ngTagsInput icon indicating copy to clipboard operation
ngTagsInput copied to clipboard

Placeholder should not be shown if there is at least one tag

Open conraddamon opened this issue 6 years ago • 2 comments

Browsers show the placeholder only if there is no input. Tags should qualify as input, so the placeholder should be removed if there is at least one tag present.

conraddamon avatar Mar 28 '18 00:03 conraddamon

You can currently accomplish this by:

  1. Enabling active interpolation of the placeholder in your app config:
.config(function(tagsInputConfigProvider) {
    tagsInputConfigProvider.setActiveInterpolation('tagsInput', { placeholder: true });
})
  1. Binding the placeholder to an expression: placeholder="{{myPlaceholder}}"

rognstad avatar Apr 10 '18 17:04 rognstad

Yep, I saw that in several places as a solution. My take is that the component should always behave that way, and it shouldn't be necessary for the client to configure it to do that. I've built autocomplete widgets before, and reasoned that wrapping up some input into a bubble/chiclet doesn't change the fact that there has been input, therefore the placeholder should not be shown.

conraddamon avatar Apr 11 '18 16:04 conraddamon