@aptre/flex-layout 0.1.3 → 0.1.4

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.mjs +28 -21
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -3153,15 +3153,17 @@ var BorderButton = (props) => {
3153
3153
  });
3154
3154
  const updateRect = () => {
3155
3155
  const layoutRect = layout.getDomRect();
3156
- const r = selfRef.current.getBoundingClientRect();
3157
- node._setTabRect(
3158
- new Rect(
3159
- r.left - layoutRect.left,
3160
- r.top - layoutRect.top,
3161
- r.width,
3162
- r.height
3163
- )
3164
- );
3156
+ const r = selfRef.current?.getBoundingClientRect();
3157
+ if (r) {
3158
+ node._setTabRect(
3159
+ new Rect(
3160
+ r.left - layoutRect.left,
3161
+ r.top - layoutRect.top,
3162
+ r.width,
3163
+ r.height
3164
+ )
3165
+ );
3166
+ }
3165
3167
  };
3166
3168
  const onTextBoxMouseDown = (event) => {
3167
3169
  event.stopPropagation();
@@ -3399,13 +3401,16 @@ var useTabOverflow = (node, orientation, toolbarRef, stickyButtonsRef) => {
3399
3401
  React5.useLayoutEffect(() => {
3400
3402
  updateVisibleTabs();
3401
3403
  });
3404
+ const instance = selfRef.current;
3402
3405
  React5.useEffect(() => {
3403
- const instance = selfRef.current;
3406
+ if (!instance) {
3407
+ return;
3408
+ }
3404
3409
  instance.addEventListener("wheel", onWheel, { passive: false });
3405
3410
  return () => {
3406
3411
  instance.removeEventListener("wheel", onWheel);
3407
3412
  };
3408
- }, []);
3413
+ }, [instance]);
3409
3414
  const onWheel = (event) => {
3410
3415
  event.preventDefault();
3411
3416
  };
@@ -4110,15 +4115,17 @@ var TabButton = (props) => {
4110
4115
  });
4111
4116
  const updateRect = () => {
4112
4117
  const layoutRect = layout.getDomRect();
4113
- const r = selfRef.current.getBoundingClientRect();
4114
- node._setTabRect(
4115
- new Rect(
4116
- r.left - layoutRect.left,
4117
- r.top - layoutRect.top,
4118
- r.width,
4119
- r.height
4120
- )
4121
- );
4118
+ const r = selfRef.current?.getBoundingClientRect();
4119
+ if (r) {
4120
+ node._setTabRect(
4121
+ new Rect(
4122
+ r.left - layoutRect.left,
4123
+ r.top - layoutRect.top,
4124
+ r.width,
4125
+ r.height
4126
+ )
4127
+ );
4128
+ }
4122
4129
  };
4123
4130
  const onTextBoxMouseDown = (event) => {
4124
4131
  event.stopPropagation();
@@ -5838,7 +5845,7 @@ var Layout = class extends React16.Component {
5838
5845
  /** @internal */
5839
5846
  _getScreenRect(node) {
5840
5847
  const rect = node.getRect().clone();
5841
- const bodyRect = this.selfRef.current.getBoundingClientRect();
5848
+ const bodyRect = this.selfRef.current?.getBoundingClientRect();
5842
5849
  if (!bodyRect) {
5843
5850
  return null;
5844
5851
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@aptre/flex-layout",
3
3
  "author": "Caplin Systems Ltd",
4
4
  "description": "A multi-tab docking layout manager",
5
- "version": "0.1.3",
5
+ "version": "0.1.4",
6
6
  "license": "ISC",
7
7
  "repository": {
8
8
  "type": "git",