Skip to content

Commit 900b239

Browse files
zyy7259JackLian
authored andcommitted
feat: pass e to customizeIgnoreSelectors
1 parent 6bb64f3 commit 900b239

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/designer/src/builtin-simulator/host.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
618618
'.next-calendar-table',
619619
'.editor-container', // 富文本组件
620620
];
621-
const ignoreSelectors = customizeIgnoreSelectors?.(defaultIgnoreSelectors) || defaultIgnoreSelectors;
621+
const ignoreSelectors = customizeIgnoreSelectors?.(defaultIgnoreSelectors, e) || defaultIgnoreSelectors;
622622
const ignoreSelectorsString = ignoreSelectors.join(',');
623623
// 提供了 customizeIgnoreSelectors 的情况下,忽略 isFormEvent() 判断
624624
if ((!customizeIgnoreSelectors && isFormEvent(e)) || target?.closest(ignoreSelectorsString)) {

packages/editor-core/src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const VALID_ENGINE_OPTIONS = {
7373
customizeIgnoreSelectors: {
7474
type: 'function',
7575
default: undefined,
76-
description: '定制画布中点击被忽略的 selectors, eg. (defaultIgnoreSelectors: string[]) => string[]',
76+
description: '定制画布中点击被忽略的 selectors, eg. (defaultIgnoreSelectors: string[], e: MouseEvent) => string[]',
7777
},
7878
disableDefaultSettingPanel: {
7979
type: 'boolean',
@@ -192,7 +192,7 @@ export interface EngineOptions {
192192
/**
193193
* 定制画布中点击被忽略的 selectors,默认值:undefined
194194
*/
195-
customizeIgnoreSelectors?: (defaultIgnoreSelectors: string[]) => string[];
195+
customizeIgnoreSelectors?: (defaultIgnoreSelectors: string[], e: MouseEvent) => string[];
196196
/**
197197
* 禁止默认的设置面板,默认值:false
198198
*/

0 commit comments

Comments
 (0)