Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/core/src/view/edge/BaseEdge.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createElement as h, Component, createRef } from 'preact/compat'
import { isFunction, isNil } from 'lodash-es'
import { Circle } from '../shape'
import { LineText } from '../text'
import LogicFlow from '../../LogicFlow'
Expand Down Expand Up @@ -565,6 +566,15 @@ export abstract class BaseEdge<P extends IProps> extends Component<
e,
position,
})
// 复制粘贴后会出现点击边时,边会失去焦点的问题,这里手动让边获焦以解决这个问题
const el = e.currentTarget as HTMLElement
const rAF =
!isNil(window) && isFunction(window.requestAnimationFrame)
? window.requestAnimationFrame.bind(window)
: (fn: () => void) => setTimeout(fn, 0)
rAF(() => {
el.focus()
})
}
const { editConfigModel } = graphModel
graphModel.selectEdgeById(model.id, isMultipleSelect(e, editConfigModel))
Expand Down