fix: emoji picker uses full panel width with no dead space

Remove width: 100% !important override that fought emoji-mart's shadow
DOM grid. Container now uses w-fit to wrap content tightly. GIF picker
gets explicit w-[390px] to maintain its own width independently.
This commit is contained in:
Jannis Braun
2026-03-15 02:39:52 +01:00
parent 42266ff963
commit 6701ccc9b4
3 changed files with 3 additions and 16 deletions
@@ -79,7 +79,7 @@ export function GifPicker({ onGifSelect }: GifPickerProps) {
};
return (
<div className="flex flex-col h-[390px]" onKeyDown={handleKeyDown}>
<div className="flex flex-col h-[390px] w-[390px]" onKeyDown={handleKeyDown}>
{/* Search */}
<div className="px-3 pt-2 pb-1.5">
<input
@@ -2,20 +2,16 @@ import React, { useRef, useEffect, useCallback } from 'react';
import { createPortal } from 'react-dom';
import { EmojiPicker } from './EmojiPicker';
import { GifPicker } from './GifPicker';
import { StickerPicker } from './StickerPicker';
import type { Sticker } from '@backspace/shared';
export type InputPopoverTab = 'emoji' | 'gif' | 'stickers';
export type InputPopoverTab = 'emoji' | 'gif';
interface InputPopoverProps {
activeTab: InputPopoverTab;
onClose: () => void;
onEmojiSelect: (emoji: { native: string }) => void;
onGifSelect: (url: string) => void;
onStickerSelect: (sticker: Sticker) => void;
anchorRef: React.RefObject<HTMLElement | null>;
gifEnabled: boolean;
stickersEnabled: boolean;
onTabChange: (tab: InputPopoverTab) => void;
}
@@ -24,10 +20,8 @@ export function InputPopover({
onClose,
onEmojiSelect,
onGifSelect,
onStickerSelect,
anchorRef,
gifEnabled,
stickersEnabled,
onTabChange,
}: InputPopoverProps) {
const floatingRef = useRef<HTMLDivElement>(null);
@@ -105,9 +99,6 @@ export function InputPopover({
if (gifEnabled) {
availableTabs.splice(0, 0, { key: 'gif', label: 'GIF' });
}
if (stickersEnabled) {
availableTabs.push({ key: 'stickers', label: 'Stickers' });
}
const showTabs = availableTabs.length > 1;
@@ -117,7 +108,7 @@ export function InputPopover({
className="fixed z-[300] animate-slide-up"
style={{ top: -9999, left: -9999 }}
>
<div className="glass rounded-xl overflow-hidden flex flex-col" style={{ width: 352, maxHeight: 435 }}>
<div className="glass rounded-xl overflow-hidden flex flex-col w-fit max-h-[435px]">
{/* Tab bar */}
{showTabs && (
<div className="flex items-center gap-0.5 px-2 pt-2 pb-1">
@@ -145,9 +136,6 @@ export function InputPopover({
{activeTab === 'gif' && gifEnabled && (
<GifPicker onGifSelect={onGifSelect} />
)}
{activeTab === 'stickers' && stickersEnabled && (
<StickerPicker onStickerSelect={onStickerSelect} />
)}
</div>
</div>
</div>,
-1
View File
@@ -303,7 +303,6 @@
--font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
border: none !important;
background: transparent !important;
width: 100% !important;
max-height: 400px;
}