kirby-icon-field icon indicating copy to clipboard operation
kirby-icon-field copied to clipboard

Lazy-loading icons

Open nilshoerrmann opened this issue 6 months ago • 3 comments

Last one (sorry for filling your issues here!):

We have a large collection of icons which will always be loaded in full on page load (3.5 MB in our case). It would be great if icons would only be fetched when opening the picklist and if there was server side filtering applied.

I know this is an issue of the core as well, see https://github.com/getkirby/kirby/issues/6043, but I think with icon sets this will become an issue for this plugin quicky.

nilshoerrmann avatar Dec 05 '23 16:12 nilshoerrmann

I'll probably not implement this until its either addressed in core or there's some other easy way to do this that doesn't involve moving away from the Core Multiselect/Tags field structure, as I don't really have a use case for this in my own projects and this would add a lot of extra complexity to the plugin (I mostly only allow a selection of icons if using a pack, or icons are designed by us anyway). I'm willing to work on a funded feature request if this is a blocker for your project.

tobimori avatar Dec 05 '23 16:12 tobimori

You could try using a SVG sprite which should minimize the initial payload.

tobimori avatar Dec 05 '23 16:12 tobimori

I totally understand that :+1: It's not a problem for us right now because we can reduce the provided icons in this particular project.

nilshoerrmann avatar Dec 05 '23 16:12 nilshoerrmann