Преглед изворни кода

fix: Emoji picker modal scrolling up when opened

https://youtrack.weseek.co.jp/issue/GW-7804
- Set body style position to static on modal opened
I Komang Mudana пре 3 година
родитељ
комит
aabc2ae187
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      packages/app/src/components/PageEditor/EmojiPickerHelper.ts

+ 2 - 0
packages/app/src/components/PageEditor/EmojiPickerHelper.ts

@@ -18,6 +18,8 @@ setStyle = ():CSSProperties => {
   const emojiPickerHeight = 420;
   const cursorPos = this.editor.cursorCoords(true);
   const editorPos = this.editor.getWrapperElement().getBoundingClientRect();
+  // Prevent body scrolls up when modal opened
+  document.body.style.position = 'static';
   // Emoji Picker bottom position exceed editor's bottom position
   if (cursorPos.bottom + emojiPickerHeight > editorPos.bottom) {
     return {