Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

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

Open
conraddamon opened this issue Mar 28, 2018 · 2 comments
Open

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

conraddamon opened this issue Mar 28, 2018 · 2 comments

Comments

@conraddamon
Copy link

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 added a commit to conraddamon/ngTagsInput that referenced this issue Mar 28, 2018
Show the placeholder only if there is no input and no tags.

Closes mbenford#855.
@rognstad
Copy link

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}}"

@conraddamon
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants