Skip to content

Commit 6a293e2

Browse files
committed
Merge branch 'planner-fix' into 9.6.0
2 parents 4f13607 + 3f67944 commit 6a293e2

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
lines changed

packages/ketchup/src/components.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ export namespace Components {
22792279
"rtl": boolean;
22802280
"scrollNumber": number;
22812281
"svgWidth": number;
2282-
"taskGanttRef": HTMLDivElement;
2282+
"taskListTrueRef": HTMLKupTaskListElement;
22832283
"taskListWidth": number;
22842284
}
22852285
interface KupIframe {
@@ -6854,7 +6854,7 @@ declare namespace LocalJSX {
68546854
"rtl"?: boolean;
68556855
"scrollNumber"?: number;
68566856
"svgWidth"?: number;
6857-
"taskGanttRef"?: HTMLDivElement;
6857+
"taskListTrueRef"?: HTMLKupTaskListElement;
68586858
"taskListWidth"?: number;
68596859
}
68606860
interface KupIframe {

packages/ketchup/src/components/kup-planner/utils/kup-gantt/kup-gantt.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export class KupGantt {
342342
*/
343343

344344
@Element() rootElement: HTMLElement;
345-
345+
taskListTrueRef: HTMLKupTaskListElement = null;
346346
//---- Lifecycle hooks ----
347347

348348
componentWillLoad() {
@@ -980,6 +980,7 @@ export class KupGantt {
980980
setDoubleView={this.setDoubleView}
981981
{...tableProps}
982982
class="tasks"
983+
ref={(el) => (this.taskListTrueRef = el)}
983984
/>
984985
)}
985986
<kup-task-gantt
@@ -1022,7 +1023,7 @@ export class KupGantt {
10221023
{this.taskGanttRef && (
10231024
<kup-horizontal-scroll
10241025
svgWidth={this.svgWidth}
1025-
taskGanttRef={this.taskGanttRef}
1026+
taskListTrueRef={this.taskListTrueRef}
10261027
taskListWidth={this.taskListWidth}
10271028
scrollNumber={this.scrollX}
10281029
rtl={this.rtl}

packages/ketchup/src/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.scss

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
.scrollWrapper {
22
overflow: auto;
33
max-width: 100%;
4-
/*firefox*/
5-
scrollbar-width: thin;
64
/*iPad*/
75
height: 1.2rem;
86
}

packages/ketchup/src/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.tsx

+8-11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class HorizontalScroll {
1616
svgWidth: number;
1717

1818
@Prop()
19-
taskGanttRef: HTMLDivElement;
19+
taskListTrueRef: HTMLKupTaskListElement;
2020

2121
@Prop()
2222
rtl: boolean;
@@ -62,20 +62,17 @@ export class HorizontalScroll {
6262
}
6363

6464
render() {
65-
const rect = this.taskGanttRef.getBoundingClientRect();
65+
const w =
66+
this.taskListTrueRef?.getBoundingClientRect().width + 24 * 1.5 ?? 0; // 24 * 2 is the sum of padding and margin for both list and gantt, multiplied by 1.5 cause we need to add the other half to the right
6667

6768
return (
6869
<div
6970
dir="ltr"
70-
style={
71-
rect
72-
? {
73-
margin: this.rtl
74-
? `0px ${rect.x}px 0px 0px`
75-
: `0px 0px 0px ${rect.x}px`,
76-
}
77-
: undefined
78-
}
71+
style={{
72+
margin: this.rtl
73+
? `0px ${w}px 0px 12px`
74+
: `0px 12px 0px ${w}px`,
75+
}}
7976
class="scrollWrapper"
8077
data-scrollx="true"
8178
onScroll={this.horizontalScroll}

packages/ketchup/src/components/kup-planner/utils/kup-vertical-scroll/kup-vertical-scroll.scss

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
overflow: hidden auto;
33
width: 1rem;
44
flex-shrink: 0;
5-
/*firefox*/
6-
scrollbar-width: thin;
75
}
86

97
.scroll::-webkit-scrollbar {

0 commit comments

Comments
 (0)