From caee41a036396771796c1962491453120eb4f449 Mon Sep 17 00:00:00 2001 From: MinJieLiu Date: Sun, 27 Feb 2022 18:29:47 +0800 Subject: [PATCH] fix: bgOpacity --- packages/react-photo-view/src/PhotoSlider.less | 1 + packages/react-photo-view/src/PhotoSlider.tsx | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-photo-view/src/PhotoSlider.less b/packages/react-photo-view/src/PhotoSlider.less index b2f345e..cb00936 100644 --- a/packages/react-photo-view/src/PhotoSlider.less +++ b/packages/react-photo-view/src/PhotoSlider.less @@ -30,6 +30,7 @@ width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); + transition-property: background-color; z-index: -1; } diff --git a/packages/react-photo-view/src/PhotoSlider.tsx b/packages/react-photo-view/src/PhotoSlider.tsx index ee2e4bc..73e015a 100644 --- a/packages/react-photo-view/src/PhotoSlider.tsx +++ b/packages/react-photo-view/src/PhotoSlider.tsx @@ -398,9 +398,8 @@ export default function PhotoSlider(props: IPhotoSliderProps) { }`} style={{ background: `rgba(0, 0, 0, ${currentOpacity})`, - transitionProperty: touched ? undefined : 'background-color', transitionTimingFunction: currentEasing, - transitionDuration: `${currentSpeed}ms`, + transitionDuration: `${touched ? 0 : currentSpeed}ms`, animationDuration: `${currentSpeed}ms`, }} onAnimationEnd={onAnimationEnd}