diff --git a/packages/amis-ui/src/components/ContextMenu.tsx b/packages/amis-ui/src/components/ContextMenu.tsx index b224dc1de..e50779c32 100644 --- a/packages/amis-ui/src/components/ContextMenu.tsx +++ b/packages/amis-ui/src/components/ContextMenu.tsx @@ -92,7 +92,7 @@ export class ContextMenu extends React.Component< } componentDidMount() { - document.body.addEventListener('click', this.handleOutClick); + document.body.addEventListener('click', this.handleOutClick, true); document.addEventListener('keydown', this.handleKeyDown); } diff --git a/packages/amis/src/schemaExtend.ts b/packages/amis/src/schemaExtend.ts index d2f119b20..5eeebb9bd 100644 --- a/packages/amis/src/schemaExtend.ts +++ b/packages/amis/src/schemaExtend.ts @@ -18,7 +18,7 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) { if (!isObject(value)) { return []; } - if (isEqual(value, this?.cachedValue)) { + if (isEqual(value, this.cachedValue)) { return this.cachedValueArray; } const arr: Array = []; @@ -56,8 +56,8 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) { obj[key] = value; }); - this && (this.cachedValue = obj); - this && (this.cachedValueArray = value); + this.cachedValue = obj; + this.cachedValueArray = value; return obj; }, items: [