mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-11 18:42:56 +00:00
fix: add protection logic for node-helper.ts when using callbacks
This commit is contained in:
parent
93e9b6ee00
commit
810ef478e5
@ -23,7 +23,7 @@ export const getClosestNode = (
|
||||
* @returns {boolean} 是否可点击,true表示可点击
|
||||
*/
|
||||
export const canClickNode = (node: IPublicModelNode, e: unknown): boolean => {
|
||||
const onClickHook = node.componentMeta?.advanced.callbacks?.onClickHook;
|
||||
const onClickHook = node.componentMeta?.advanced?.callbacks?.onClickHook;
|
||||
const canClick = typeof onClickHook === 'function' ? onClickHook(e as MouseEvent, node) : true;
|
||||
return canClick;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user