Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

only append visible svg items in modal for perf, #8 #9

Merged
merged 2 commits into from
Oct 2, 2018

Conversation

idflood
Copy link
Contributor

@idflood idflood commented Sep 24, 2018

This is a first approach of how to handle a lot of svg items.

Items are absolutely positioned and only visible items are appended to the dom. Once an item become invisible it is added to a recycled_items array and reused later. With this solution there is roughly less than 50 <li> items in the <ul>, no matter how much icons are available.

Without this change, opening the modal when there was 10'000 icons was making the browser nearly unresponsive (> 10 seconds), and searching was nearly impossible. With this first patch, opening, searching and scrolling feel instantaneous.

@houke houke merged commit 29644be into houke:master Oct 2, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants