fix: error and warning in mobile (#2475)

This commit is contained in:
Konv Suu 2025-01-06 17:57:24 +08:00 committed by GitHub
parent b46e1780f7
commit ff1dc03304
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -233,6 +233,7 @@ export const EntryList: FC<EntryListProps> = memo(
ref={rowVirtualizer.measureElement}
className="absolute left-0 top-0 w-full will-change-transform"
key={virtualRow.key}
data-index={virtualRow.index}
style={{
transform,
}}

View File

@ -110,6 +110,7 @@ export const PresentSheet = forwardRef<SheetRef, PropsWithChildren<PresentSheetP
style={{
zIndex: contentZIndex,
}}
aria-describedby={undefined}
className={cn(
"fixed inset-x-0 bottom-0 flex max-h-[calc(100svh-3rem)] flex-col rounded-t-[10px] border-t bg-theme-modal-background-opaque pt-4",
modalClassName,

View File

@ -26,12 +26,12 @@ export function withResponsiveSyncComponent<P extends object, R = any>(
) {
return forwardRef<R, P>(function ResponsiveLayout(props: PropsWithoutRef<P>, ref) {
const isMobile = useMobile()
const componentProps = { ...props, ref } as P & RefAttributes<R>
const componentProps = { ...props } as P & RefAttributes<R>
return isMobile ? (
<MobileComponent {...componentProps} />
) : (
<DesktopComponent {...componentProps} />
<DesktopComponent {...componentProps} ref={ref} />
)
})
}