Skip to content

Commit 510a8d2

Browse files
authored
Merge pull request #82 from aeagle/fix-overlayhandle-prop
Fix overlayhandle prop
2 parents 6f731f7 + fccd18e commit 510a8d2

File tree

5 files changed

+44
-76
lines changed

5 files changed

+44
-76
lines changed

.storybook/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-spaces-storybook",
3-
"version": "0.1.28",
3+
"version": "0.1.29",
44
"files": [
55
"**/*.*"
66
],

package-lock.json

+4-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-spaces",
3-
"version": "0.1.28",
3+
"version": "0.1.29",
44
"main": "dist/index.js",
55
"module": "dist/es/index.js",
66
"types": "dist/index.d.ts",

src/components/Space.tsx

+34-65
Original file line numberDiff line numberDiff line change
@@ -124,71 +124,40 @@ export const SpaceInternal: React.FC<AllProps> = React.memo((props) => {
124124
onDoubleClick: props.onDoubleClick,
125125
};
126126

127-
return props.resizable && props.scrollable
128-
? React.createElement(
129-
props.as || "div",
130-
{
131-
...{
132-
id: space.id,
133-
ref: spaceElement,
134-
className: outerClasses.join(" "),
135-
},
136-
...passThroughEvents,
137-
},
138-
<>
139-
<HeadStyles spaces={currentContext.children} />
140-
<ResizeHandle
141-
resizable={props.resizable}
142-
anchor={props.anchor}
143-
parentContext={parentContext}
144-
space={space}
145-
spaceElement={spaceElement.current}
146-
minimumSize={props.minimumSize}
147-
maximumSize={props.maximumSize}
148-
onResizeStart={props.onResizeStart}
149-
onResizeEnd={props.onResizeEnd}
150-
/>
151-
<div className={innerClasses.join(" ")} style={innerStyle}>
152-
<SpaceContext.Provider value={currentContext}>
153-
<SpaceInfoContext.Provider value={{ width: Math.floor(currentSize.width), height: Math.floor(currentSize.height) }}>
154-
{children}
155-
</SpaceInfoContext.Provider>
156-
</SpaceContext.Provider>
157-
</div>
158-
</>,
159-
)
160-
: React.createElement(
161-
props.as || "div",
162-
{
163-
...{
164-
id: space.id,
165-
ref: spaceElement,
166-
className: outerClasses.join(" "),
167-
style: innerStyle,
168-
},
169-
...passThroughEvents,
170-
},
171-
<>
172-
<HeadStyles spaces={currentContext.children} />
173-
<ResizeHandle
174-
resizable={props.resizable}
175-
anchor={props.anchor}
176-
parentContext={parentContext}
177-
space={space}
178-
handleSize={handleSize}
179-
spaceElement={spaceElement.current}
180-
minimumSize={props.minimumSize}
181-
maximumSize={props.maximumSize}
182-
onResizeStart={props.onResizeStart}
183-
onResizeEnd={props.onResizeEnd}
184-
/>
185-
<SpaceContext.Provider value={currentContext}>
186-
<SpaceInfoContext.Provider value={{ width: Math.floor(currentSize.width), height: Math.floor(currentSize.height) }}>
187-
{children}
188-
</SpaceInfoContext.Provider>
189-
</SpaceContext.Provider>
190-
</>,
191-
);
127+
const width = Math.floor(currentSize.width);
128+
const height = Math.floor(currentSize.height);
129+
130+
return React.createElement(
131+
props.as || "div",
132+
{
133+
...{
134+
id: space.id,
135+
ref: spaceElement,
136+
className: outerClasses.join(" "),
137+
},
138+
...passThroughEvents,
139+
},
140+
<>
141+
<HeadStyles spaces={currentContext.children} />
142+
<ResizeHandle
143+
resizable={props.resizable}
144+
anchor={props.anchor}
145+
parentContext={parentContext}
146+
space={space}
147+
spaceElement={spaceElement.current}
148+
handleSize={handleSize}
149+
minimumSize={props.minimumSize}
150+
maximumSize={props.maximumSize}
151+
onResizeStart={props.onResizeStart}
152+
onResizeEnd={props.onResizeEnd}
153+
/>
154+
<div className={innerClasses.join(" ")} style={innerStyle}>
155+
<SpaceContext.Provider value={currentContext}>
156+
<SpaceInfoContext.Provider value={{ width: width, height: height }}>{children}</SpaceInfoContext.Provider>
157+
</SpaceContext.Provider>
158+
</div>
159+
</>,
160+
);
192161
});
193162

194163
SpaceInternal.propTypes = allProps;

src/components/stories/00-docs/04-ChangeHistory.stories.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import { CommonHeader } from "../Utils";
77

88
## Change history
99

10+
### 0.1.29
11+
12+
- Fixed overlayHandle property on resizable spaces which was broken in `0.1.25`
13+
1014
### 0.1.28
1115

1216
- Ensure proptypes added as direct dependency to library

0 commit comments

Comments
 (0)