diff --git a/packages/amis/src/renderers/Tag.tsx b/packages/amis/src/renderers/Tag.tsx index c0ae5def9..24c29a260 100644 --- a/packages/amis/src/renderers/Tag.tsx +++ b/packages/amis/src/renderers/Tag.tsx @@ -77,16 +77,8 @@ export interface TagSchema extends BaseSchema { export interface TagProps extends RendererProps, Omit { - onClick?: (params: { - [propName: string]: any; - nativeEvent: React.MouseEvent; - label: string; - }) => void; - onClose?: (params: { - [propName: string]: any; - nativeEvent: React.MouseEvent; - label: string; - }) => void; + onClick?: (params: {[propName: string]: any}) => void; + onClose?: (params: {[propName: string]: any}) => void; } export class TagField extends React.Component { @@ -97,7 +89,7 @@ export class TagField extends React.Component { @autobind handleClick(nativeEvent: React.MouseEvent) { const {dispatchEvent, onClick} = this.props; - const params = this.getResolvedEventParams(nativeEvent); + const params = this.getResolvedEventParams(); dispatchEvent(nativeEvent, params); onClick?.(params); @@ -106,7 +98,7 @@ export class TagField extends React.Component { @autobind handleMouseEnter(e: React.MouseEvent) { const {dispatchEvent} = this.props; - const params = this.getResolvedEventParams(e); + const params = this.getResolvedEventParams(); dispatchEvent(e, params); } @@ -114,7 +106,7 @@ export class TagField extends React.Component { @autobind handleMouseLeave(e: React.MouseEvent) { const {dispatchEvent} = this.props; - const params = this.getResolvedEventParams(e); + const params = this.getResolvedEventParams(); dispatchEvent(e, params); } @@ -122,7 +114,7 @@ export class TagField extends React.Component { @autobind handleClose(nativeEvent: React.MouseEvent) { const {dispatchEvent, onClose} = this.props; - const params = this.getResolvedEventParams(nativeEvent); + const params = this.getResolvedEventParams(); dispatchEvent( { @@ -185,7 +177,7 @@ export class TagField extends React.Component { ); } - private getResolvedEventParams(nativeEvent: T) { + private getResolvedEventParams() { const {data} = this.props; return createObject(data, {