fix(PhotoViewerTransitionPreview): correct z-index on transition (#112)

This commit is contained in:
Chrys
2025-09-30 13:53:24 +08:00
committed by GitHub
parent 517e943c93
commit 9c96fea48b
2 changed files with 9 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ export const PhotoViewerTransitionPreview = ({
return (
<m.div
className="pointer-events-none fixed top-0 left-0 z-[40]"
className="pointer-events-none fixed top-0 left-0 z-40"
data-variant={`photo-viewer-transition-${transition.variant}`}
initial={{
x: transition.from.left,

View File

@@ -26,7 +26,14 @@ export const Component = () => {
return (
<RootPortal>
<RootPortalProvider value={rootPortalValue}>
<RemoveScroll ref={ref} className="fixed inset-0 z-[9999]">
<RemoveScroll
ref={ref}
className={
photoViewer.isOpen
? 'fixed inset-0 z-[9999]'
: 'pointer-events-none fixed inset-0 z-40'
}
>
<PhotoViewer
photos={photos}
currentIndex={photoViewer.currentIndex}