Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get suggestion list (full list) to show when tags-input receives focus? #23

Closed
ledgeJumper opened this issue Jan 28, 2014 · 2 comments

Comments

@ledgeJumper
Copy link

Not sure if this is the right place for this question. Close this if it isn't. I have the plugin all set up and working. What I would like to have is either one of these things (prefferably number 1):

  1. Rather than have a tag input, I would like a drop down list of all my available tags (I am restricting input). When they click one, it adds the tag.
  2. Using the input rather than drop down list, when the input receives focus, show the whole list of suggestions.
@maxwells
Copy link
Owner

maxwells commented Feb 2, 2014

Yeah - this plugin wasn't designed to do #1. If a user presses the down arrow while the input has focus, then it will show the list of suggestions. You could add a focus event handler to the input that calls makeSuggestions with the event as the first parameter and true as the second (this will cause the plugin to display all the suggestions when the input is empty). I don't plan to implement this in the near future.

I havent tried this, but something like:

src/bootstrap-tags.coffee

L370

@onFocusHandler = (event) =>
  @makeSuggestions(event, true)

L390

@input.focus @onFocusHandler

Or if you'd rather just hack on the javascript

dist/js/bootstrap-tags.js

L409

this.onFocusHandler = function(event) {
  this.makeSuggestions(event, true);
};

L427

this.input.focus(this.onFocusHandler);

@maxwells maxwells closed this as completed Feb 2, 2014
@zifang
Copy link

zifang commented Feb 5, 2014

thank you very much

------------------ 原始邮件 ------------------
发件人: "David Stanley";notifications@github.com;
发送时间: 2014年1月28日(星期二) 晚上10:47
收件人: "maxwells/bootstrap-tags"bootstrap-tags@noreply.github.com;

主题: [bootstrap-tags] How to get suggestion list (full list) to show whentags-input receives focus? (#23)

Not sure if this is the right place for this question. Close this if it isn't. I have the plugin all set up and working. What I would like to have is either one of these things (prefferably number 1):

Rather than have a tag input, I would like a drop down list of all my available tags (I am restricting input). When they click one, it adds the tag.

Using the input rather than drop down list, when the input receives focus, show the whole list of suggestions.


Reply to this email directly or view it on GitHub.

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

No branches or pull requests

3 participants