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

Remove currently selected element from list #172

Closed
zachshallbetter opened this issue May 22, 2013 · 7 comments
Closed

Remove currently selected element from list #172

zachshallbetter opened this issue May 22, 2013 · 7 comments
Assignees

Comments

@zachshallbetter
Copy link

When the user has selected an item the same item remains in the dropdown list. This isn't a bug, but it would be useful to allow us to "remove selected from list" with a custom option.

screen shot 2013-05-22 at 1 43 29 pm screen shot 2013-05-22 at 1 43 22 pm

@ghost ghost assigned gfranko May 22, 2013
@gfranko
Copy link
Owner

gfranko commented May 22, 2013

Would the options that are removed have to be reinserted back into the drop down if a new option was selected?

@zachshallbetter
Copy link
Author

Yeah, when you select a different item from the list the currently selected one would return back to it's original position.

@gfranko
Copy link
Owner

gfranko commented May 22, 2013

I like your idea and will add it as an option in the next release! One more question... when you reopen the drop down, should no options look like they are selected?

@zachshallbetter
Copy link
Author

Excellent, thanks! Yeah I would say that the currently selected item shouldn't appear in the list at all.

@ianshea
Copy link

ianshea commented May 22, 2013

@gfranko - I'm working on this same project where this idea popped up with @zachshallbetter . I'd suggest handling it with a class. That way default functionality could be preserved and then with CSS a user could indicate a 'Selected' state or hide the element if desired with some CSS.

@gfranko
Copy link
Owner

gfranko commented May 23, 2013

@irock195 I agree that handling this via CSS logic is definitely the way to go. SelectBoxIt already applies a selected class, so this shouldn't be a hard feature to implement.

@gfranko
Copy link
Owner

gfranko commented Jun 25, 2013

I just released SelectBoxIt v3.6.0, which adds a hideCurrent option that you can set to true to have the currently selected drop down option hidden from the user. Here is how you would use it:

$('select').selectBoxIt({ hideCurrent: true });

@gfranko gfranko closed this as completed Jun 25, 2013
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

3 participants