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.
Files changed (2) hide show
  1. package/dist/index.js +3 -2
  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(disabled);
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]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yet-another-react-lightbox",
3
- "version": "3.11.2",
3
+ "version": "3.11.3",
4
4
  "description": "Modern React lightbox component",
5
5
  "author": "Igor Danchenko",
6
6
  "license": "MIT",