mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-14 04:43:14 +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表示可点击
|
* @returns {boolean} 是否可点击,true表示可点击
|
||||||
*/
|
*/
|
||||||
export const canClickNode = (node: IPublicModelNode, e: unknown): boolean => {
|
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;
|
const canClick = typeof onClickHook === 'function' ? onClickHook(e as MouseEvent, node) : true;
|
||||||
return canClick;
|
return canClick;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user