fix(a11y): Drawer always renders SheetDescription — silence Radix warning
This commit is contained in:
@@ -58,7 +58,18 @@ export function Drawer({
|
||||
{(title || description) && (
|
||||
<SheetHeader>
|
||||
{title && <SheetTitle>{title}</SheetTitle>}
|
||||
{description && <SheetDescription>{description}</SheetDescription>}
|
||||
{/* Radix Dialog требует accessible description ИЛИ
|
||||
* aria-describedby={undefined}. Рендерим SheetDescription всегда
|
||||
* когда есть header: визуально если передан description, sr-only
|
||||
* fallback иначе — заглушает Radix dev warning + полезно для
|
||||
* screen reader users. */}
|
||||
{description ? (
|
||||
<SheetDescription>{description}</SheetDescription>
|
||||
) : (
|
||||
<SheetDescription className="sr-only">
|
||||
Боковая панель. Нажмите Escape или кнопку закрытия чтобы вернуться.
|
||||
</SheetDescription>
|
||||
)}
|
||||
</SheetHeader>
|
||||
)}
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user