@homebound/beam 2.91.1 → 2.91.5

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.
@@ -7,6 +7,11 @@ const utils_1 = require("../../utils");
7
7
  function useModal() {
8
8
  const { modalState, modalCanCloseChecks } = (0, BeamContext_1.useBeamContext)();
9
9
  const lastCanClose = (0, react_1.useRef)();
10
+ (0, react_1.useEffect)(() => {
11
+ return () => {
12
+ modalCanCloseChecks.current = modalCanCloseChecks.current.filter((c) => c !== lastCanClose.current);
13
+ };
14
+ }, [modalCanCloseChecks]);
10
15
  return (0, react_1.useMemo)(() => ({
11
16
  openModal(props) {
12
17
  // TODO Check already open?
@@ -340,7 +340,7 @@ function calcVirtualGridColumns(columns, firstLastColumnWidth) {
340
340
  else {
341
341
  throw new Error("as=virtual only supports px, percentage, or fr units");
342
342
  }
343
- }, { claimedPercentages: 0, claimedPixels: 0, totalFr: 0 });
343
+ }, { claimedPercentages: 0, claimedPixels: firstLastColumnWidth ? firstLastColumnWidth * 2 : 0, totalFr: 0 });
344
344
  // This is our "fake but for some reason it lines up better" fr calc
345
345
  function fr(myFr) {
346
346
  return `calc((100% - ${claimedPercentages}% - ${claimedPixels}px) * (${myFr} / ${totalFr}))`;
@@ -71,10 +71,12 @@ function SelectFieldBase(props) {
71
71
  selectedKeys: [firstKey],
72
72
  selectedOptions: firstSelectedOption ? [firstSelectedOption] : [],
73
73
  });
74
- // When a single select menu item changes, then blur the field
75
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
76
74
  }
77
75
  selectionChanged && onSelect([...keys.values()].map(Value_1.keyToValue));
76
+ if (!multiselect) {
77
+ // When a single select menu item changes, then blur the field AFTER `onSelect` has been called
78
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
79
+ }
78
80
  }
79
81
  function onInputChange(value) {
80
82
  setFieldState((prevState) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.91.1",
3
+ "version": "2.91.5",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",