Skip to content

Commit 98671c2

Browse files
committed
All known bugs removed for Native Mode on Konva
1 parent 620c037 commit 98671c2

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"d3": "^5.9.2",
111111
"electron-reload": "^1.4.0",
112112
"enzyme": "^3.4.1",
113-
"konva": "^4.1.6",
113+
"konva": "^4.2.0",
114114
"localforage": "^1.7.2",
115115
"lodash.throttle": "^4.1.1",
116116
"material-table": "^1.25.2",

src/components/left/LeftColExpansionPanel.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
6767
handleChangeName,
6868
handleEditComponent,
6969
focusChild,
70+
changeFocusChild
7071
} = props;
7172
const { title, id, color, stateful, classBased } = component;
7273
function isFocused() {
@@ -99,7 +100,6 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
99100
if (focusComponent.props.length > 0) {
100101
focusComponent.props.forEach(key => parentKeys.push(key.key));
101102
}
102-
console.log('this is parentKeys', parentKeys);
103103
// sorting through object keys of the focusComponent
104104

105105
let i = 0;
@@ -187,6 +187,11 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
187187
if (focusComponent.title !== title)
188188
//changed the logic here so it only focuses if you click on a different card. Otherwise, you can't double click into edit mode for the title.
189189
changeFocusComponent({ title });
190+
changeFocusChild({childId : -1});
191+
changeComponentFocusChild({
192+
componentId: 1,
193+
childId: -1
194+
});
190195
}}
191196
>
192197
<ListItemText

src/components/main/Rectangle.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ interface RectanglePorpsInt extends PropsInt {
3333
native:boolean;
3434
}
3535

36+
3637
class Rectangle extends Component<RectanglePorpsInt> {
3738
rect: Konva.Rect;
3839
group: Konva.Group;
@@ -56,7 +57,7 @@ class Rectangle extends Component<RectanglePorpsInt> {
5657
handleResize(
5758
componentId: number,
5859
childId: number,
59-
target: Konva.Group,
60+
target: Konva.Rect | Konva.Stage, //unsolved bug in Konva typescript for this type
6061
blockSnapSize: number
6162
) {
6263
//find the id of the component where the componentID in the state equals the currently focused component
@@ -105,7 +106,7 @@ class Rectangle extends Component<RectanglePorpsInt> {
105106
handleDrag(
106107
componentId: number,
107108
childId: number,
108-
target: Konva.Group,
109+
target: any,
109110
blockSnapSize: number
110111
) {
111112
const transformation = {
@@ -177,7 +178,7 @@ class Rectangle extends Component<RectanglePorpsInt> {
177178
stroke={
178179
childType === 'COMP'
179180
? this.getComponentColor(childComponentId)
180-
: native && componentId === 1 ? null : '#000000' //sets the parent component color to black
181+
: native && componentId === 1 && childType !== 'HTML' ? null : '#000000' //sets the parent component color to black
181182
}
182183
onTransformEnd={event =>
183184
this.handleResize(componentId, childId, event.target, blockSnapSize)

src/containers/LeftContainer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ class LeftContainer extends Component<LeftContPropsInt, StateInt> {
310310
toggleEditMode={toggleEditMode}
311311
handleChangeName={this.handleChangeName}
312312
handleEditComponent={this.handleEditComponent}
313+
changeFocusChild={changeFocusChild}
313314
changeComponentFocusChild={changeComponentFocusChild}
314315
focusChild={focusChild}
315316
/>

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"target": "es6",
88
"jsx": "react",
99
"lib": ["es6", "dom", "es2017"],
10-
"allowSyntheticDefaultImports": true
10+
"allowSyntheticDefaultImports": true,
11+
"strictFunctionTypes": false
1112
},
1213
"include": ["./src/**/*"]
1314
}

0 commit comments

Comments
 (0)