Skip to content

fix: display SVG emojis in the picker #16492

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

Merged
merged 3 commits into from
Feb 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix lint
  • Loading branch information
BrunoQuaresma committed Feb 7, 2025
commit c66fe9de170b3b75113744d1d0bcd9a191919a56
23 changes: 14 additions & 9 deletions site/src/components/IconField/EmojiPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import data from "@emoji-mart/data/sets/15/apple.json";
import EmojiMart from "@emoji-mart/react";
import { useEffect, useLayoutEffect, type ComponentProps, type FC } from "react";
import {
type ComponentProps,
type FC,
useEffect,
useLayoutEffect,
} from "react";
import icons from "theme/icons.json";

const custom = [
Expand Down Expand Up @@ -33,17 +38,17 @@ const EmojiPicker: FC<EmojiPickerProps> = (props) => {
* Reference: https://github.com/missive/emoji-mart/pull/806
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps link the original issue too: missive/emoji-mart#805

*/
useEffect(() => {
const picker = document.querySelector("em-emoji-picker")?.shadowRoot
if(!picker) {
return
const picker = document.querySelector("em-emoji-picker")?.shadowRoot;
if (!picker) {
return;
}
const css = document.createElement("style")
css.textContent = `.emoji-mart-emoji img { width: 100% }`
picker.appendChild(css)
}, [])
const css = document.createElement("style");
css.textContent = ".emoji-mart-emoji img { width: 100% }";
picker.appendChild(css);
}, []);

return (
<EmojiMart
<EmojiMart
theme="dark"
set="apple"
emojiVersion="15"
Expand Down
Loading