Bläddra i källkod

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 år sedan
förälder
incheckning
aabc2ae187
1 ändrade filer med 2 tillägg och 0 borttagningar
  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 emojiPickerHeight = 420;
   const cursorPos = this.editor.cursorCoords(true);
   const cursorPos = this.editor.cursorCoords(true);
   const editorPos = this.editor.getWrapperElement().getBoundingClientRect();
   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
   // Emoji Picker bottom position exceed editor's bottom position
   if (cursorPos.bottom + emojiPickerHeight > editorPos.bottom) {
   if (cursorPos.bottom + emojiPickerHeight > editorPos.bottom) {
     return {
     return {