File tree Expand file tree Collapse file tree
packages/core/src/view/edge Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { createElement as h , Component , createRef } from 'preact/compat'
2+ import { isFunction , isNil } from 'lodash-es'
23import { Circle } from '../shape'
34import { LineText } from '../text'
45import LogicFlow from '../../LogicFlow'
@@ -565,6 +566,15 @@ export abstract class BaseEdge<P extends IProps> extends Component<
565566 e,
566567 position,
567568 } )
569+ // 复制粘贴后会出现点击边时,边会失去焦点的问题,这里手动让边获焦以解决这个问题
570+ const el = e . currentTarget as HTMLElement
571+ const rAF =
572+ ! isNil ( window ) && isFunction ( window . requestAnimationFrame )
573+ ? window . requestAnimationFrame . bind ( window )
574+ : ( fn : ( ) => void ) => setTimeout ( fn , 0 )
575+ rAF ( ( ) => {
576+ el . focus ( )
577+ } )
568578 }
569579 const { editConfigModel } = graphModel
570580 graphModel . selectEdgeById ( model . id , isMultipleSelect ( e , editConfigModel ) )
You can’t perform that action at this time.
0 commit comments