angularjs-dropdown-multiselect
angularjs-dropdown-multiselect copied to clipboard
Wrong abbreviation with smartButtonText and display: inline-block
Demo: https://plnkr.co/edit/uijC3SN3aFVbw0FlQeo0?p=info
If the parent <div> of ng-dropdown-multiselect is set to display: inline-block items with texts, which are longer than the buttonDefaultText, will be abbreviated strangely.
I think that it should be possible to disable the abbreviation of the itemtexts (which was added with #294). Maybe we can introduce a new option like smartButtonDisableTextAbbreviation. What do you think?
In v2 it's working better, I'll take a look to make the behaviour the same, I'm not going to add more features to v1
I could make a PR for v1?
Btw. with v2 the text is not abbreviated strangely but other items will also not shown if selected because the width is not increased. This makes smartButtonMaxItems > 1 useless because only one item will be shown.
Demo for v2: https://plnkr.co/edit/XSDgiH8YXkZOsxrFZWuE?p=preview
That's because the width is not big enough to display more than 1 item. If you set a higher width, more items will be shown and the ... Will be logical
Of course you're right but what I want to achieve is the behaviour of angularjs-dropdown-multiselect before commit 60ea42c9bc0100db694fad056ce8381588e04106. The width shall grow or shrink depending on the buttonText. Since commit 60ea42c9bc0100db694fad056ce8381588e04106 this is not possible anymore without further changes. Demo for angularjs-dropdown-multiselect commit 60ea42c9bc0100db694fad056ce8381588e04106: https://plnkr.co/edit/fcdsuALoqjn35d06Pu01?p=preview
All right, I'm following, that's probably something I'll try to add to v2, if it's easily back portable to v1 I'll take a look at that, but I'm trying to not touch v1 that much anymore.
Thanks for your consideration! I don't need a backport to v1. In the meantime I'll use a forked version of v1.
I found the hidden 'feature' in the settings object called smartButtonTextProvider which is called with the selected-model array when the button is to be drawn (if the selected model is not empty). In this I could assemble my own string and the resulting string bypasses the width check, setting the button to the string returned without clipping or '...' added.