Skip to content

Commit aa92f88

Browse files
committed
Applied fix for scrollable spaces
1 parent 6a4bb9c commit aa92f88

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

src/core-utils.ts

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ export function styleDefinition(space: ISpaceDefinition) {
9191

9292
const cssString: string[] = [];
9393

94-
if (space.scrollable) {
95-
cssString.push(`overflow: auto;`);
96-
cssString.push(`touch-action: auto;`);
97-
}
9894
if (style.position) {
9995
cssString.push(`position: ${style.position};`);
10096
}
@@ -124,11 +120,14 @@ export function styleDefinition(space: ISpaceDefinition) {
124120
cssElements.push(`#${space.id} { ${cssString.join(" ")} }`);
125121
}
126122

123+
if (space.scrollable) {
124+
cssElements.push(`#${space.id} > .spaces-space-inner { overflow: auto; touch-action: auto; }`);
125+
}
126+
127127
let handleOffset = 0;
128-
const touchHandleSize = (space.touchHandleSize / 2) - (space.handleSize / 2);
128+
const touchHandleSize = space.touchHandleSize / 2 - space.handleSize / 2;
129129

130-
switch (space.handlePlacement)
131-
{
130+
switch (space.handlePlacement) {
132131
case ResizeHandlePlacement.Inside:
133132
case ResizeHandlePlacement.OverlayInside:
134133
handleOffset = space.handleSize;
@@ -139,22 +138,34 @@ export function styleDefinition(space: ISpaceDefinition) {
139138
}
140139

141140
if (space.canResizeLeft) {
142-
cssElements.push(`#${space.id}-m { left: calc(${css(space.left, true)} + ${css(space.width, true)} - ${handleOffset}px); width: ${space.handleSize}px; }`);
141+
cssElements.push(
142+
`#${space.id}-m { left: calc(${css(space.left, true)} + ${css(space.width, true)} - ${handleOffset}px); width: ${space.handleSize}px; }`,
143+
);
143144
cssElements.push(`#${space.id}-m:after { left: -${touchHandleSize}px; right: -${touchHandleSize}px; top: 0; bottom: 0; }`);
144145
}
145146

146147
if (space.canResizeTop) {
147-
cssElements.push(`#${space.id}-m { top: calc(${css(space.top, true)} + ${css(space.height, true)} - ${handleOffset}px); height: ${space.handleSize}px; }`);
148+
cssElements.push(
149+
`#${space.id}-m { top: calc(${css(space.top, true)} + ${css(space.height, true)} - ${handleOffset}px); height: ${space.handleSize}px; }`,
150+
);
148151
cssElements.push(`#${space.id}-m:after { top: -${touchHandleSize}px; bottom: -${touchHandleSize}px; left: 0; right: 0; }`);
149152
}
150153

151154
if (space.canResizeRight) {
152-
cssElements.push(`#${space.id}-m { right: calc(${css(space.right, true)} + ${css(space.width, true)} - ${handleOffset}px); width: ${space.handleSize}px; }`);
155+
cssElements.push(
156+
`#${space.id}-m { right: calc(${css(space.right, true)} + ${css(space.width, true)} - ${handleOffset}px); width: ${
157+
space.handleSize
158+
}px; }`,
159+
);
153160
cssElements.push(`#${space.id}-m:after { left: -${touchHandleSize}px; right: -${touchHandleSize}px; top: 0; bottom: 0; }`);
154161
}
155162

156163
if (space.canResizeBottom) {
157-
cssElements.push(`#${space.id}-m { bottom: calc(${css(space.bottom, true)} + ${css(space.height, true)} - ${handleOffset}px); height: ${space.handleSize}px; }`);
164+
cssElements.push(
165+
`#${space.id}-m { bottom: calc(${css(space.bottom, true)} + ${css(space.height, true)} - ${handleOffset}px); height: ${
166+
space.handleSize
167+
}px; }`,
168+
);
158169
cssElements.push(`#${space.id}-m:after { top: -${touchHandleSize}px; bottom: -${touchHandleSize}px; left: 0; right: 0; }`);
159170
}
160171

0 commit comments

Comments
 (0)