File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,7 @@ const reducer = (state: State, action: Action) => {
268
268
if ( childTypeExists ( 'Component' , parentComponentId , originalComponent ) )
269
269
return state ;
270
270
}
271
+
271
272
let newName = state . HTMLTypes . reduce ( ( name , el ) => {
272
273
if ( typeId === el . id ) {
273
274
name = type === 'Component' ? componentName : el . tag ;
@@ -316,8 +317,14 @@ const reducer = (state: State, action: Action) => {
316
317
// if there is a childId (childId here references the direct parent of the new child) find that child and a new child to its children array
317
318
else {
318
319
directParent = findChild ( parentComponent , childId ) ;
319
- directParent . children . push ( topSeparator ) ;
320
- directParent . children . push ( newChild ) ;
320
+ if ( directParent . type === "HTML Element" && type === "HTML Element" ) {
321
+ directParent . children . push ( topSeparator ) ;
322
+ directParent . children . push ( newChild ) ;
323
+ } else {
324
+ console . log ( 'sorry cant drag comp into html bruh' )
325
+ return state ;
326
+ }
327
+
321
328
}
322
329
const canvasFocus = {
323
330
...state . canvasFocus ,
You can’t perform that action at this time.
0 commit comments