From ab44c51cdf3f85c68295e8e596af78dcefcd34fd Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 24 Jul 2026 23:06:08 -0500 Subject: [PATCH] fix positioning --- src/app/features/room/RoomInput.tsx | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/app/features/room/RoomInput.tsx b/src/app/features/room/RoomInput.tsx index 2871428b5..3b03e96bd 100644 --- a/src/app/features/room/RoomInput.tsx +++ b/src/app/features/room/RoomInput.tsx @@ -2343,14 +2343,22 @@ export const RoomInput = forwardRef( alignOffset={-44} position="Top" align="End" - anchor={ - emojiBoardTab === undefined - ? undefined - : (emojiBtnRef.current?.getBoundingClientRect() ?? - gifBtnRef.current?.getBoundingClientRect() ?? - stickerBtnRef.current?.getBoundingClientRect() ?? - undefined) - } + anchor={(() => { + if (emojiBoardTab === undefined) return undefined; + const buttonRefs: Record> = { + gif: gifBtnRef, + sticker: stickerBtnRef, + emoji: emojiBtnRef, + }; + for (let i = editorButtonOrder.length - 1; i >= 0; i--) { + const id = editorButtonOrder[i]; + const ref = buttonRefs[id]; + if (ref?.current) { + return ref.current.getBoundingClientRect(); + } + } + return undefined; + })()} content={emojiBoard} > {triggers}