about summary refs log tree commit diff
path: root/src/view/com/composer/text-input/web/EmojiPicker.web.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-12-17 21:12:53 -0600
committerGitHub <noreply@github.com>2024-12-17 21:12:53 -0600
commita07949ec8e63bae178a829f65c33fcd9622b28ec (patch)
treecfb00eb0f15de398ce4114a0718ecf2d33121166 /src/view/com/composer/text-input/web/EmojiPicker.web.tsx
parent65d4416f9e30b58c32c02cf65bc84db53c952a87 (diff)
downloadvoidsky-a07949ec8e63bae178a829f65c33fcd9622b28ec.tar.zst
Fix emoji picker position (#7146)
Diffstat (limited to 'src/view/com/composer/text-input/web/EmojiPicker.web.tsx')
-rw-r--r--src/view/com/composer/text-input/web/EmojiPicker.web.tsx71
1 files changed, 37 insertions, 34 deletions
diff --git a/src/view/com/composer/text-input/web/EmojiPicker.web.tsx b/src/view/com/composer/text-input/web/EmojiPicker.web.tsx
index 1d5dad486..c72172902 100644
--- a/src/view/com/composer/text-input/web/EmojiPicker.web.tsx
+++ b/src/view/com/composer/text-input/web/EmojiPicker.web.tsx
@@ -10,6 +10,7 @@ import {DismissableLayer} from '@radix-ui/react-dismissable-layer'
 
 import {textInputWebEmitter} from '#/view/com/composer/text-input/textInputWebEmitter'
 import {atoms as a} from '#/alf'
+import {Portal} from '#/components/Portal'
 
 const HEIGHT_OFFSET = 40
 const WIDTH_OFFSET = 100
@@ -125,39 +126,41 @@ export function EmojiPicker({state, close, pinToTop}: IProps) {
   }
 
   return (
-    <TouchableWithoutFeedback
-      accessibilityRole="button"
-      onPress={onPressBackdrop}
-      accessibilityViewIsModal>
-      <View
-        style={[
-          a.fixed,
-          a.w_full,
-          a.h_full,
-          a.align_center,
-          {
-            top: 0,
-            left: 0,
-            right: 0,
-          },
-        ]}>
-        {/* eslint-disable-next-line react-native-a11y/has-valid-accessibility-descriptors */}
-        <TouchableWithoutFeedback onPress={e => e.stopPropagation()}>
-          <View style={[{position: 'absolute'}, position]}>
-            <DismissableLayer
-              onFocusOutside={evt => evt.preventDefault()}
-              onDismiss={close}>
-              <Picker
-                data={async () => {
-                  return (await import('./EmojiPickerData.json')).default
-                }}
-                onEmojiSelect={onInsert}
-                autoFocus={true}
-              />
-            </DismissableLayer>
-          </View>
-        </TouchableWithoutFeedback>
-      </View>
-    </TouchableWithoutFeedback>
+    <Portal>
+      <TouchableWithoutFeedback
+        accessibilityRole="button"
+        onPress={onPressBackdrop}
+        accessibilityViewIsModal>
+        <View
+          style={[
+            a.fixed,
+            a.w_full,
+            a.h_full,
+            a.align_center,
+            {
+              top: 0,
+              left: 0,
+              right: 0,
+            },
+          ]}>
+          {/* eslint-disable-next-line react-native-a11y/has-valid-accessibility-descriptors */}
+          <TouchableWithoutFeedback onPress={e => e.stopPropagation()}>
+            <View style={[{position: 'absolute'}, position]}>
+              <DismissableLayer
+                onFocusOutside={evt => evt.preventDefault()}
+                onDismiss={close}>
+                <Picker
+                  data={async () => {
+                    return (await import('./EmojiPickerData.json')).default
+                  }}
+                  onEmojiSelect={onInsert}
+                  autoFocus={true}
+                />
+              </DismissableLayer>
+            </View>
+          </TouchableWithoutFeedback>
+        </View>
+      </TouchableWithoutFeedback>
+    </Portal>
   )
 }