Skip to content

Commit

Permalink
feat: fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ascoders committed Nov 28, 2019
1 parent a25d2f7 commit bfd7632
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15,929 deletions.
9 changes: 9 additions & 0 deletions packages/react-schema-editor/src/components/SchemaTree.tsx
Expand Up @@ -39,6 +39,15 @@ export const SchemaTree: React.FC<ISchemaTreeProps> = ({
return
}

if (
(targetPath === 'root' && sourcePath.split('.').length === 2) ||
(targetPath !== 'root' &&
fp.dropRight(2, sourcePath.split('.')).join('.') === targetPath)
) {
// 拖拽到直接父节点,等于不起作用
return
}

let newSchema = schema

// 增加新的 key
Expand Down

0 comments on commit bfd7632

Please sign in to comment.