Skip to content

Commit

Permalink
fix(core): fix drag source component
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Aug 27, 2021
1 parent a417930 commit 6784528
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/models/DragSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class DragSource {
}

getSourcesByGroup(group: string) {
const parent = this.tree.findById(`${this.prefix}_${group}`)
const parent = this.tree.findById(`${this.prefix}-${group}`)
return parent?.children
}

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/widgets/DragSourceWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const DragSourceWidget: React.FC<IDragSourceWidgetProps> = observer(
const source =
workspace?.source?.size > 0 ? workspace.source : designer.source
const sources = source.getSourcesByGroup(props.name)
const remainItems = sources.length % 3
const remainItems = sources?.length % 3
return (
<div
className={cls(prefix, props.className, {
Expand Down

0 comments on commit 6784528

Please sign in to comment.