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

Replace values in single-item selection #1104

Closed
nuno-agostinho opened this issue Jul 7, 2016 · 5 comments
Closed

Replace values in single-item selection #1104

nuno-agostinho opened this issue Jul 7, 2016 · 5 comments

Comments

@nuno-agostinho
Copy link

Selectize.js is great even for single-item selection. The problem is that after the user has selected the item, s/he needs to delete the selected item and start typing to search from the beginning. I think it would be more intuitive if the "deletion" step wasn't needed.

Steps to reproduce:

  1. Click selectize input box
  2. Type a few letters

Expected result: Delete the selected item and search the available items.

Actual result: Nothing happens, since step 2 is actually "delete selected item" and only step 3 is "type a few letters"

@joallard
Copy link
Member

joallard commented Jul 7, 2016

Related to #110

@JacobEvelyn
Copy link

JacobEvelyn commented Aug 29, 2016

Note that Select2 behaves this way, to see a concrete example.

@bettysteger
Copy link

Also related to #996

@javvkenn
Copy link

This solution might be late but it might be of help to someone. This will reopen the textbox for edit and select all the text when the use focuses on the element.

var select = $('select[name=\"$name\"]').selectize({}); var selectizeControl = select[0].selectize selectizeControl.on('focus', function() { var value = selectizeControl.getItem(selectizeControl.getValue()).text(); selectizeControl.clear(); //remove selected item selectizeControl.setTextboxValue(value); //re-populate search input $('input[type=select-one]').select(); });

oyejorge added a commit to orchidjs/tom-select that referenced this issue Sep 18, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

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

No branches or pull requests

5 participants