mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-16 03:18:11 +00:00
feat: 支持自定制画布中被忽略的节点选择器 - customizeIgnoreSelectors
This commit is contained in:
parent
0d6b690594
commit
b5edc4b140
@ -695,8 +695,9 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
|||||||
this._iframe?.dispatchEvent(x);
|
this._iframe?.dispatchEvent(x);
|
||||||
const target = e.target as HTMLElement;
|
const target = e.target as HTMLElement;
|
||||||
|
|
||||||
|
const customizeIgnoreSelectors = engineConfig.get('customizeIgnoreSelectors', (defaultSelectors: string[]) => defaultSelectors);
|
||||||
// TODO: need more elegant solution to ignore click events of components in designer
|
// TODO: need more elegant solution to ignore click events of components in designer
|
||||||
const ignoreSelectors: any = [
|
const defaultIgnoreSelectors: any = [
|
||||||
'.next-input-group',
|
'.next-input-group',
|
||||||
'.next-checkbox-group',
|
'.next-checkbox-group',
|
||||||
'.next-checkbox-wrapper',
|
'.next-checkbox-wrapper',
|
||||||
@ -718,6 +719,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
|||||||
'.next-calendar-table',
|
'.next-calendar-table',
|
||||||
'.editor-container', // 富文本组件
|
'.editor-container', // 富文本组件
|
||||||
];
|
];
|
||||||
|
const ignoreSelectors = customizeIgnoreSelectors(defaultIgnoreSelectors);
|
||||||
const ignoreSelectorsString = ignoreSelectors.join(',');
|
const ignoreSelectorsString = ignoreSelectors.join(',');
|
||||||
if (isFormEvent(e) || target?.closest(ignoreSelectorsString)) {
|
if (isFormEvent(e) || target?.closest(ignoreSelectorsString)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@ -199,6 +199,10 @@ interface EngineOptions {
|
|||||||
* 关闭拖拽组件时的虚线响应,性能考虑,默认值:false
|
* 关闭拖拽组件时的虚线响应,性能考虑,默认值:false
|
||||||
*/
|
*/
|
||||||
disableDetecting?: boolean;
|
disableDetecting?: boolean;
|
||||||
|
/**
|
||||||
|
* 定制画布中点击被忽略的 selectors,默认值:(selectors) => selectors
|
||||||
|
*/
|
||||||
|
customizeIgnoreSelectors?: (defaultIgnoreSelectors: string[]) => string[];
|
||||||
/**
|
/**
|
||||||
* Vision-polyfill settings
|
* Vision-polyfill settings
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user