verbb / icon-picker

A Craft CMS field to select SVG or font icons from a folder for use in your content.
Other
17 stars 8 forks source link

Only first icon set is shown in picker, others hidden unless searched #12

Closed michaelroper closed 5 years ago

michaelroper commented 5 years ago

Description

If i have multiple icon sets selected for a field, I can only see the first set in the picker window. However if I search the name of an icon from another icon set, that icon set header and the icon that weren't visible before will now be shown.

icon-picker 2019-04-17 14_07_23

Additional info

engram-design commented 5 years ago

So when you open the dropdown to select an icon, we limit the number of icons shown to 100. This can be lock up the CP due to the DOM struggling with thousands of items in that dropdown.

I have now added a maxIconsShown config option if you'd like to override this.

michaelroper commented 5 years ago

Ah, that makes sense, and fair enough. I'll have a play with that config option and see how it goes.

I know this was primarily a port of the previous C2 plugin, but I wonder if there's improvements that could be made in either what component is used, and how they are displayed, that might help performance. If i get a chance, I might have a dig in myself!

engram-design commented 5 years ago

For sure, we're just using Selectize which is pretty robust, and sure we could do our own, but I'd rather not. I'd certainly need to dive into some performance improvements, be in front-end or server-side.