-
Notifications
You must be signed in to change notification settings - Fork 93
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
feat: Optional virtualize, imageUrlFn #369
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be of great help 🙏
pass emoji use button prop
@scttcper let me know if you need anything from me to get this merged in |
I'll be adding an optional parameter to allow virtualized offset height |
add virtualizeOffset input
I have pushed changes to customize virtual scrolling visibility. README is updated. default is |
@scttcper All set! Let me know if you find anything else. It's looking smooth on my end. When I find some time I'll look into rendering emojis by row. |
🎉 This PR is included in version 5.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hey guys, I think something else changed because now the performance is increidibly better without using |
Description
New props:
imageUrlFn - Allows the fetching of each emoji image URL
virtualize - experimental scrolling for emojis to avoid loading all 3000 emojis in one load.
Motivation and Context
The main motivation for this change was responsiveness when opening the emoji picker around complex components. ngx-emoji-mart works very well in the standalone github page, but when loaded into an app that consumes a fair amount of system resources, the initialization and rendering times of all the emojis were not acceptable. The option to show a single category is better but affects the end-user experience. To mitigate this, virtual scrolling was implemented per category (this could be enhanced to be per row of emojis). Instead of fetching the whole sprite sheet, I've also allowed the option to fetch individual emojis. This is more convenient for those loading a few emojis in view (whether from browser cache or some type of CDN). The use case would be the end-user who uses 10 of the 3000 emojis. Used with the new
virtualize
prop, it will reduce the amount data getting loaded into ngx-emoji-mart.How has this been tested?
This has been tested thoroughly on my local machine. Virtualization is completely optional and experimental, so it will need to improved at some point. For now, this will cover basic use cases.
Screenshots (if appropriate):
Looks the same as what exists in
master
todayTypes of changes
Checklist: