Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Add option to make the placeholder always visible #1612

Closed
jtrancas opened this issue May 18, 2016 · 3 comments
Closed

Add option to make the placeholder always visible #1612

jtrancas opened this issue May 18, 2016 · 3 comments

Comments

@jtrancas
Copy link

jtrancas commented May 18, 2016

I'd like to request the addition of a new option to ui-select-match (or ui-select) as a flag which would let the user to choose if the placeholder should be always visible independently if there're already selected items or not.
In some situations when you have a multiple choices ui-select it'd be interesting to have the placeholder always visible, i.e. "Add tags...", it'd be more intuitive to the user to click on that place to start writing and adding more tags (i.e. the LinkedIn endorsements input).

According to what i saw on the source it's just a matter of adding the attribute and adjusting the getPlaceholder() method located on the uiSelectMultiple directive. (I'll try to implement this and make a pull-request)

For now I've achieved the same effect by overriding the "bootstrap/select-multiple.tpl.html" template (because I'm using the bootstrap theme) and displaying $select.placeholder directly instead of relying on getPlaceholder() return value, but this is not that elegant and is more difficult to maintain.

@user378230
Copy link
Contributor

user378230 commented May 25, 2016

#1433 may help you

@user378230
Copy link
Contributor

For reference in #1433 I wrote

This can probably be written as a separate directive:

app.directive('placeholderAlwaysVisible', function() {
  return {
    require: 'uiSelect',
    link: function($scope, $element, attrs, $select) {     
      $select.getPlaceholder = function () {
        return $select.placeholder;
      }
    }
  }
}); 

@moussa-b
Copy link

moussa-b commented Aug 2, 2017

Hi @Jefiozie, can you please tell us when do you plan to merge this job?

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

No branches or pull requests

3 participants