فهرست منبع

Merge pull request #5818 from weseek/feat/gw7798-pick-an-emoji-with-keyboard-operation

feat: gw7798 pick an emoji with keyboard operation
cao 3 سال پیش
والد
کامیت
951a77ad6a
3فایلهای تغییر یافته به همراه7 افزوده شده و 6 حذف شده
  1. 1 1
      packages/app/package.json
  2. 2 1
      packages/app/src/components/PageEditor/EmojiPicker.tsx
  3. 4 4
      yarn.lock

+ 1 - 1
packages/app/package.json

@@ -187,7 +187,7 @@
     "csv-to-markdown-table": "^1.0.1",
     "diff2html": "^3.1.2",
     "eazy-logger": "^3.1.0",
-    "emoji-mart": "^3.0.1",
+    "emoji-mart": "npm:panta82-emoji-mart@^3.0.1",
     "markdown-it-emoji-mart": "^0.1.1",
     "eslint-plugin-cypress": "^2.12.1",
     "eslint-plugin-regex": "^1.8.0",

+ 2 - 1
packages/app/src/components/PageEditor/EmojiPicker.tsx

@@ -22,8 +22,9 @@ const EmojiPicker: FC<Props> = (props: Props) => {
 
   // Set search emoji input and trigger search
   const searchEmoji = () => {
+    const input = window.document.querySelector('[id^="emoji-mart-search"]') as HTMLInputElement;
     if (emojiSearchText !== null) {
-      const input = window.document.querySelector('[id^="emoji-mart-search"]') as HTMLInputElement;
+
       const valueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value')?.set;
       valueSetter?.call(input, emojiSearchText);
       const event = new Event('input', { bubbles: true });

+ 4 - 4
yarn.lock

@@ -7609,10 +7609,10 @@ emittery@^0.8.1:
   resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860"
   integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==
 
-emoji-mart@^3.0.1:
-  version "3.0.1"
-  resolved "https://registry.yarnpkg.com/emoji-mart/-/emoji-mart-3.0.1.tgz#9ce86706e02aea0506345f98464814a662ca54c6"
-  integrity sha512-sxpmMKxqLvcscu6mFn9ITHeZNkGzIvD0BSNFE/LJESPbCA8s1jM6bCDPjWbV31xHq7JXaxgpHxLB54RCbBZSlg==
+"emoji-mart@npm:panta82-emoji-mart@^3.0.1":
+  version "3.0.1003"
+  resolved "https://registry.yarnpkg.com/panta82-emoji-mart/-/panta82-emoji-mart-3.0.1003.tgz#8febed01a0a731ba84caaddf1ba5b1ac724562ac"
+  integrity sha512-JLCNrxoyOb/m/0kGWJZK7QGl/+t82cQrFgbbieeevBxp+lD8pnAb4Bsa4kJzV7xNwMYlNlHDAZJsM//Xb5eJ2Q==
   dependencies:
     "@babel/runtime" "^7.0.0"
     prop-types "^15.6.0"