From 19d0d99bc0e74ff328187d2225c5c18e946f951d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A0=97=E5=98=89=E7=94=B7?= <574980606@qq.com> Date: Fri, 28 Jul 2023 11:05:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/Check.tsx | 12 ++++++------ src/radio/Radio.tsx | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/Check.tsx b/src/common/Check.tsx index d21f92786..c30ec48ff 100644 --- a/src/common/Check.tsx +++ b/src/common/Check.tsx @@ -1,4 +1,4 @@ -import React, { forwardRef, useContext, MouseEvent } from 'react'; +import React, { forwardRef, useContext, MouseEvent, ChangeEvent } from 'react'; import classNames from 'classnames'; import isBoolean from 'lodash/isBoolean'; import { omit } from '../_util/helper'; @@ -53,9 +53,7 @@ const Check = forwardRef((_props, ref) => { const TOnChange: ( checked: boolean, - context: { - e: React.ChangeEvent | React.MouseEvent; - }, + context: { e: ChangeEvent | MouseEvent }, ) => void = onChange; const [internalChecked, setInternalChecked] = useControlled(props, 'checked', TOnChange); @@ -90,9 +88,11 @@ const Check = forwardRef((_props, ref) => { // Checkbox/ Radio 内容为空则不再渲染 span,不存在 0:Number 的情况 const showLabel = !!(children || label); - const handleLabelClick = (event) => { + const handleLabelClick = (event: MouseEvent) => { // 在tree等组件中使用 阻止label触发checked 与expand冲突 - if (props.stopLabelTrigger) event.preventDefault(); + if (props.stopLabelTrigger) { + event.preventDefault(); + } }; const onInnerClick = (e: MouseEvent) => { diff --git a/src/radio/Radio.tsx b/src/radio/Radio.tsx index d679d70c3..347eb5e1a 100644 --- a/src/radio/Radio.tsx +++ b/src/radio/Radio.tsx @@ -14,7 +14,7 @@ const Radio = forwardRefWithStatics( { Group: RadioGroup, Button: forwardRef((props, ref) => ( - (props, radioDefaultProps)} /> + )), }, );