@mackin.com/styleguide 8.0.0-beta.21 → 8.0.0-beta.22

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/index.js +8 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1475,11 +1475,17 @@ const Modal = (p) => {
1475
1475
  return () => {
1476
1476
  var _a;
1477
1477
  // handle the use of modals that are rendered only as show=true and then unmounted.
1478
+ //TB: BUG, handle unmounted if already showing.
1479
+ // p.show here doesn't work. we need some sort of ref that is controlled via the p.show call below
1478
1480
  if (p.show) {
1481
+ log(`un-mount in progress and this modal is showing. decrement the backdrop and try to remove singleton body styles.`);
1479
1482
  backdrop.setShow(false, (_a = p.id) !== null && _a !== void 0 ? _a : 'Modal');
1480
1483
  log('backdrop.setShow', false);
1481
1484
  tryRemoveBodyStyles();
1482
1485
  }
1486
+ else {
1487
+ log(`un-mount in progress but this modal is not showing. do nothing with the backdrop.`);
1488
+ }
1483
1489
  log('un-mounted');
1484
1490
  };
1485
1491
  }, []);
@@ -1496,10 +1502,11 @@ const Modal = (p) => {
1496
1502
  });
1497
1503
  }
1498
1504
  if (show) {
1499
- log('adding singleton htmlBodyStyles');
1505
+ log('this modal is showing. adding singleton htmlBodyStyles');
1500
1506
  document.body.classList.add(htmlBodyStyles);
1501
1507
  }
1502
1508
  else {
1509
+ log('this modal is hiding. try removing singleton htmlBodyStyles');
1503
1510
  tryRemoveBodyStyles();
1504
1511
  }
1505
1512
  }, p.show);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mackin.com/styleguide",
3
- "version": "8.0.0-beta.21",
3
+ "version": "8.0.0-beta.22",
4
4
  "description": "",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",