yet-another-react-lightbox 3.11.2 → 3.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -491,9 +491,10 @@ function useForkRef(refA, refB) {
|
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
function useLoseFocus(focus, disabled = false) {
|
|
494
|
-
const focused = React.useRef(
|
|
494
|
+
const focused = React.useRef();
|
|
495
495
|
useLayoutEffect(() => {
|
|
496
|
-
if (disabled) {
|
|
496
|
+
if (disabled && focused.current) {
|
|
497
|
+
focused.current = false;
|
|
497
498
|
focus();
|
|
498
499
|
}
|
|
499
500
|
}, [disabled, focus]);
|