Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 3 commits intomainfrombq/fix-custom-emojis
Feb 7, 2025
Merged
Changes fromall commits
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
24 changes: 23 additions & 1 deletionsite/src/components/IconField/EmojiPicker.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
import data from "@emoji-mart/data/sets/15/apple.json";
import EmojiMart from "@emoji-mart/react";
import type { ComponentProps, FC } from "react";
import {
type ComponentProps,
type FC,
useEffect,
useLayoutEffect,
} from "react";
import icons from "theme/icons.json";

const custom = [
Expand All@@ -26,6 +31,23 @@ type EmojiPickerProps = Omit<
>;

const EmojiPicker: FC<EmojiPickerProps> = (props) => {
/**
* Workaround for a bug in the emoji-mart library where custom emoji images render improperly.
* Setting the image width to 100% ensures they display correctly.
*
* Issue: https://github.com/missive/emoji-mart/issues/805
* Open PR: https://github.com/missive/emoji-mart/pull/806
*/
useEffect(() => {
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);
}, []);

return (
<EmojiMart
theme="dark"
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp