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

multi-selection of filetered items #206

Closed
bgadiel opened this issue Jul 25, 2016 · 14 comments
Closed

multi-selection of filetered items #206

bgadiel opened this issue Jul 25, 2016 · 14 comments
Labels

Comments

@bgadiel
Copy link

bgadiel commented Jul 25, 2016

Hi,
I am implementing a 'Multiple Select' by passing an array of objects to ng-options.
When filtering results with a search query (e.g: typing the letter 'a'), I am trying to select all results (using 'Shift' key).
Problem is that the list is getting refreshed after every selection and the search query is deleted, therefore I need to type the query again and again after each 1 item selection.

Is there a way to be able to multi-select the filtered results?

It works great in 'Multiple Select' example in Chosen page.

@bgadiel bgadiel changed the title Disable drop-down refresh applying selection with filter Disable auto drop-down refresh after applying selection with filter Jul 25, 2016
@bgadiel bgadiel changed the title Disable auto drop-down refresh after applying selection with filter multi-selection of filetered items Jul 25, 2016
@leocaseiro
Copy link
Owner

Hi @bgadiel, thank you for using angular-chosen.

I'm sorry, I tried to multi-select using the shift key, but it didn;'t work for me. None on angular-chosen and not even on jquery chosen.

However, it's working with the Command key(on mac) in both of them. Have you tried that?

@leocaseiro
Copy link
Owner

There's a well-known issue while selecting a big list. The list is going to the top.

Please read more at #59.

@bgadiel
Copy link
Author

bgadiel commented Jul 26, 2016

Yes, its working with the 'command' key. and Yes, I am having a big list to select from.
in 'going to the top' meaning the list is refreshed?
The behaviour that I see that if I filter 1000 results using the string 'abc', and now I have 10 items.
I try to select all 10 items using 'command' key, but after each item selection, the list returns back to 1000 items.

@leocaseiro
Copy link
Owner

Hi @bgadiel, I've release a new version with this fix.
Could you please try the version 1.4.3?

If doesn't work, could you please create a plunkr for me?

@bgadiel
Copy link
Author

bgadiel commented Jul 26, 2016

Works perfectly with version 1.4.3!
Thanks.

@bgadiel
Copy link
Author

bgadiel commented Nov 22, 2017

Hi,
This issue occurs again in chosen#1.8.0. - see here.
Short description - search for the letter 'c' and click CMD / CTRL while multi-selecting.
The list of values should all be filtered with 'c' as long as the CTRL / CMD is pressed, while in fact the list is refreshed for every selection you make.
This is not happening with chosen#1.7.0.
(I am not sure this is a bug in the angular-chosen, though).
How do I revert back to chosen#1.7.0 when reinstalling angular-chosen-localytics#1.7.0 with bower? (bower auto fetch the latest chosen version).

Thanks.

@VanTanev
Copy link
Collaborator

VanTanev commented Nov 22, 2017

@bgadiel Per the bower spec, bower uses node-semver. Specifying

"angular-chosen-localytics": "1.7.0",

should resolve exactly 1.7.0

@bgadiel
Copy link
Author

bgadiel commented Nov 22, 2017

@VanTanev , from some reason it didnt work for me, so I had to manually install chosen with bower to 1.7.0 in addition to "angular-chosen-localytics": "1.7.0".
thanks.

@leocaseiro
Copy link
Owner

Hi @bgadiel, I'm sorry I wasn't able to reproduce your bug.

Here is a video of myself searching with the cmd on mac and without pressing it.
You can see on my screen video that everytime I hold the command, the list still there.

ifwg2rrfdi

@bgadiel
Copy link
Author

bgadiel commented Nov 23, 2017 via email

@leocaseiro
Copy link
Owner

Hi @bgadiel. Did you see my GIF?

I typed a holding cmd and it worked as expected.

screen shot 2017-11-23 at 5 22 18 pm

@bgadiel
Copy link
Author

bgadiel commented Nov 23, 2017

Oh, my plnkr was not saved.
@leocaseiro , Try with this
Working good with old version, but not with 1.8.0

@leocaseiro
Copy link
Owner

Hi @bgadiel, Thanks for reporting that.

I found out that the issue is actually with the chosen library. Since [email protected] the behaviour for command + click changed and I didn't notice.
They added a new option hide_results_on_select that's true by default.

Test yourself https://jsfiddle.net/v3kLhyu2/
PS: This demo is jquery chosen without angular.

This feature works great in case you don't want your users to hold cmd while selecting their options.

We need to open an issue on Chosen Library.

For the time being, I suggest you use an older version that [email protected] that the latest library that works the way you want.

I'm almost sure it was caused by this PR harvesthq/chosen#2867 related to harvesthq/chosen#2809

@bgadiel
Copy link
Author

bgadiel commented Nov 24, 2017 via email

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

No branches or pull requests

3 participants