better handling of opacity after pinch zooming

This commit is contained in:
jongomez 2023-09-25 18:39:50 +01:00 committed by Jon
parent 634ccf157d
commit c17df709a6
1 changed files with 6 additions and 3 deletions

View File

@ -180,6 +180,12 @@ export const LightBox = ({ children, caption }: LightBoxProps) => {
</>
)
// Edge case: if the user pinches to zoom in, and presses the exit fullscreen button,
// the opacity of the caption will be set to 0. This will reset it to 1.
if (captionRef.current) {
captionRef.current.style.opacity = '1'
}
return (
<>
{isActive && (
@ -232,9 +238,6 @@ const LightBoxCaption = styled.figcaption<{ isActive?: boolean }>`
height: 72px;
overflow: auto;
`}
// Edge case: when users are pinch zooming and press exit fullscreen - opacity will be 0.
${(props) => !props.isActive && `opacity: 1 !important;`}
`
const Backdrop = styled.div`