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

Icons dropdown (for choosing a tabler icon) is very slow #17522

Closed
orthagh opened this issue Jul 16, 2024 · 6 comments
Closed

Icons dropdown (for choosing a tabler icon) is very slow #17522

orthagh opened this issue Jul 16, 2024 · 6 comments

Comments

@orthagh
Copy link
Contributor

orthagh commented Jul 16, 2024

No description provided.

@cconard96
Copy link
Contributor

How slow is it for you? It takes about a second for me.
It isn't really surprising given Select2 is rendering 4739 options with span elements being created using createElement and inserted into the DOM every time it is opened. Showing just the icon names still has a noticeable delay for me, but is improved.

@orthagh
Copy link
Contributor Author

orthagh commented Jul 19, 2024

It isn't really surprising

No indeed

I opened the issue up more so that discussions could happen.
Select2 is not a good choice for this control, I let it pass initially because it eased the selection (instead of a text input).
But we should find a new way for an icon selector.

Inspiration could come from messenger applications where they display an emojis selector.

@orthagh
Copy link
Contributor Author

orthagh commented Jul 19, 2024

lib ideas:
https://github.com/migliori/universal-icon-picker -> I don't like their UI but they have a demo with tabler
https://github.com/noeGnh/vue3-icon-picker -> vue3
https://github.com/AppoloDev/vanilla-icon-picker -> no tabler direct implementation but support iconify JSON, it should be possible (it relies by default on SVG, so not so easy)
https://fonticonpicker.github.io/ -> does not rely on any icon library by default and just transforms a classic select

In several options (applodev, fonticonpicker), we need to have the list of icons and pass it to the js function. We may find a list provided by @tabler/icons package to construct the select (maybe we already do this ?)

@orthagh
Copy link
Contributor Author

orthagh commented Jul 19, 2024

I tried a bit the last one:
image
It works but as it rely on jquery, I'm not pleased (still an enhancement on actual implementation)

I'm very interested to see the vue one in action as it includes tabler directly but I lack the experience to import the thing

@orthagh
Copy link
Contributor Author

orthagh commented Jul 19, 2024

A note that's said, the jquery lib seems to be the only one to have a category feature (like { 'category label': ['ti ti...', ...]})

@orthagh
Copy link
Contributor Author

orthagh commented Jul 22, 2024

I will write a bunch of stuff today to see if we can just make a pagination to local data with the existing method using select2
In fact it could be the best option (same component as usual) rather than choosing an additional library for that
An alternative could be using an ajax source for icons also.

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

2 participants