angularjs-dropdown-multiselect icon indicating copy to clipboard operation
angularjs-dropdown-multiselect copied to clipboard

Wrong abbreviation with smartButtonText and display: inline-block

Open m4r71n opened this issue 8 years ago • 7 comments

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?

m4r71n avatar Mar 29 '17 13:03 m4r71n

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

pkempenaers avatar Mar 29 '17 13:03 pkempenaers

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

m4r71n avatar Mar 29 '17 13:03 m4r71n

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

pkempenaers avatar Mar 29 '17 16:03 pkempenaers

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

m4r71n avatar Mar 29 '17 18:03 m4r71n

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.

pkempenaers avatar Mar 29 '17 18:03 pkempenaers

Thanks for your consideration! I don't need a backport to v1. In the meantime I'll use a forked version of v1.

m4r71n avatar Mar 29 '17 18:03 m4r71n

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.

galmok avatar Jul 03 '17 12:07 galmok