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

countSelectedText not working when only 1 item is selected #2367

Closed
cbrianball opened this issue Dec 30, 2019 · 3 comments
Closed

countSelectedText not working when only 1 item is selected #2367

cbrianball opened this issue Dec 30, 2019 · 3 comments

Comments

@cbrianball
Copy link

I have tried setting countSelectedText to both a string template as well as a function.
I've also tried setting selectedTextFormat to both count and count > 0.

It works fine if I select more than 1 item, but if I only select 1, I just see that item's text (which in my case doesn't look good since I use a template for each item).

I can understand the default of selectedTextFormat: "count" only showing the countSelectedText value if more than 1 is selected, but at the very least, I would expect "count>0" to work where it shows my countSelectedText template if only one item is selected.

I've narrowed down the issue to one line of code:

showCount = this.multiple && this.options.selectedTextFormat.indexOf('count') !== -1 && selectedCount > 1;

Here's a quick reproduction of the issue (I kept it as simple as possible, even opting to use the default countSelectText (and not defining my own).

http://jsfiddle.net/k2ph0vcm/

@mikemix
Copy link

mikemix commented Mar 19, 2020

Still doesn't work.

@mirko77
Copy link

mirko77 commented Feb 10, 2021

I have the same issue

@NicolasCARPi
Copy link
Collaborator

Fixed in beta3 version.

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