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

Commitde70ff3

Browse files
fix: display SVG emojis in the picker (#16492)
Fix#16263
1 parent6a67e2e commitde70ff3

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

‎site/src/components/IconField/EmojiPicker.tsx‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
importdatafrom"@emoji-mart/data/sets/15/apple.json";
22
importEmojiMartfrom"@emoji-mart/react";
3-
importtype{ComponentProps,FC}from"react";
3+
import{
4+
typeComponentProps,
5+
typeFC,
6+
useEffect,
7+
useLayoutEffect,
8+
}from"react";
49
importiconsfrom"theme/icons.json";
510

611
constcustom=[
@@ -26,6 +31,23 @@ type EmojiPickerProps = Omit<
2631
>;
2732

2833
constEmojiPicker:FC<EmojiPickerProps>=(props)=>{
34+
/**
35+
* Workaround for a bug in the emoji-mart library where custom emoji images render improperly.
36+
* Setting the image width to 100% ensures they display correctly.
37+
*
38+
* Issue: https://github.com/missive/emoji-mart/issues/805
39+
* Open PR: https://github.com/missive/emoji-mart/pull/806
40+
*/
41+
useEffect(()=>{
42+
constpicker=document.querySelector("em-emoji-picker")?.shadowRoot;
43+
if(!picker){
44+
return;
45+
}
46+
constcss=document.createElement("style");
47+
css.textContent=".emoji-mart-emoji img { width: 100% }";
48+
picker.appendChild(css);
49+
},[]);
50+
2951
return(
3052
<EmojiMart
3153
theme="dark"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp