Refactor GalleryPanel and GalleryBrowser for improved layout and functionality
Updated the GalleryPanel component to ensure it occupies the full screen height, enhancing the user experience by preventing dual scrollbars. Modified the GalleryBrowser to support a new 'fill' prop, allowing it to adapt its layout based on the context, and adjusted the internal scrolling behavior accordingly. These changes improve the overall usability and visual consistency of the image gallery interface.
This commit is contained in:
@@ -44,6 +44,7 @@ export function ShowPicker({
|
||||
const [query, setQuery] = useState('')
|
||||
const [active, setActive] = useState(0)
|
||||
const listRef = useRef<HTMLDivElement>(null)
|
||||
const searchRef = useRef<HTMLInputElement>(null)
|
||||
|
||||
const trimmed = query.trim()
|
||||
const matches = useMemo(() => {
|
||||
@@ -133,9 +134,15 @@ export function ShowPicker({
|
||||
<PopoverContent
|
||||
className="w-[var(--radix-popover-trigger-width)] min-w-64 p-1"
|
||||
onKeyDown={onKeyDown}
|
||||
onOpenAutoFocus={(event) => {
|
||||
// Фокус наводим сами: внутри диалога за него борются две фокус-ловушки, и по умолчанию
|
||||
// он оседает на самом поповере — строка поиска остаётся мёртвой.
|
||||
event.preventDefault()
|
||||
requestAnimationFrame(() => searchRef.current?.focus())
|
||||
}}
|
||||
>
|
||||
<Input
|
||||
autoFocus
|
||||
ref={searchRef}
|
||||
className="h-8"
|
||||
placeholder={t('admin.shows.pickerSearch')}
|
||||
value={query}
|
||||
|
||||
Reference in New Issue
Block a user