-
Notifications
You must be signed in to change notification settings - Fork 87
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
API to override favorite emojis #323
Comments
I thought about just asking for CSS to hide the favorites bar so I could display my own. That'd suit more use cases, but I'm not sure how I'd get the items in my custom favorites bar to line up with the emoji picker's columns. |
Interesting, so you want to manage all the favorites yourself? Not just the default favorites? How are you planning to determine the list – is it hardcoded? Getting them to line up would be very tricky; there is code in emoji-picker-element to calculate the scrollbar width and account for that on platforms that show it (Windows, Linux). |
It would be dynamic. I'm using the picker to apply emoji as content tags. I'd like to display favorites based on the tags presently attached to the user's data, including changes made on other devices. That'd also automatically factor in changes in emoji usage over time as old content gets removed. |
I see, so would it be acceptable to you to have an API something like this? const picker = new Picker({
favorites: ['😅', '😺', '🪵', '🤪', '👍️', '👏', '⚽️', '🎯']
}) or: const picker = document.querySelector('emoji-picker')
picker.favorites = ['😅', '😺', '🪵', '🤪', '👍️', '👏', '⚽️', '🎯'] Basically the API would let you pass in a list of 8 emoji that you want to show in the favorites bar. You can update it yourself based on whatever criteria you want. I guess we could also have an HTML attribute version, but it may be awkward since it would have to be a string. |
Yeah, that would take care of what I need. I like the second code snippet; it'd be easy to have SolidJS grab me a reference to the picker element. |
Placing above might look kind of weird – the grid is supposed to be aligned with the favorites bar (note in your screenshot the gap on the right to account for the scrollbar). |
I suggest placing the fav bar above by default, since it declutters the UI. As it stands, one would not know its a fav bar, but if its placed above, with a bottom-border to separate - then the user knows that its a special bar. Then it can be used in multiple ways based on some prop setting:
Thats just a bit of flex centering... |
I'd like to display favorites based on application data from outside emoji-picker-element.
Could we get a method on
Database
that clears the favorites counts and replaces them with the provided data?The text was updated successfully, but these errors were encountered: