From c241665837e40cbca2d9818c81674fb1d74b60c6 Mon Sep 17 00:00:00 2001 From: daisy <47104575+linxianxi@users.noreply.github.com> Date: Thu, 15 Jun 2023 09:46:05 +0800 Subject: [PATCH] fix: Radio.Button title loss (#43012) --- components/checkbox/Checkbox.tsx | 5 +++-- components/checkbox/Group.tsx | 2 ++ components/radio/group.tsx | 1 + package.json | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/checkbox/Checkbox.tsx b/components/checkbox/Checkbox.tsx index 459f38b75d28..f35c41b25a5c 100644 --- a/components/checkbox/Checkbox.tsx +++ b/components/checkbox/Checkbox.tsx @@ -2,11 +2,11 @@ import classNames from 'classnames'; import type { CheckboxRef } from 'rc-checkbox'; import RcCheckbox from 'rc-checkbox'; import * as React from 'react'; +import warning from '../_util/warning'; import { ConfigContext } from '../config-provider'; +import DisabledContext from '../config-provider/DisabledContext'; import { FormItemInputContext } from '../form/context'; -import warning from '../_util/warning'; import { GroupContext } from './Group'; -import DisabledContext from '../config-provider/DisabledContext'; import useStyle from './style'; @@ -18,6 +18,7 @@ export interface AbstractCheckboxProps { checked?: boolean; style?: React.CSSProperties; disabled?: boolean; + title?: string; onChange?: (e: T) => void; onClick?: React.MouseEventHandler; onMouseEnter?: React.MouseEventHandler; diff --git a/components/checkbox/Group.tsx b/components/checkbox/Group.tsx index ce583f6bd338..ac05a8386757 100644 --- a/components/checkbox/Group.tsx +++ b/components/checkbox/Group.tsx @@ -14,6 +14,7 @@ export interface CheckboxOptionType { value: CheckboxValueType; style?: React.CSSProperties; disabled?: boolean; + title?: string; onChange?: (e: CheckboxChangeEvent) => void; } @@ -132,6 +133,7 @@ const InternalCheckboxGroup: React.ForwardRefRenderFunction {option.label} diff --git a/components/radio/group.tsx b/components/radio/group.tsx index 8d0053d2ec04..92c1e3a97fd1 100644 --- a/components/radio/group.tsx +++ b/components/radio/group.tsx @@ -76,6 +76,7 @@ const RadioGroup = React.forwardRef((props, ref disabled={option.disabled || disabled} value={option.value} checked={value === option.value} + title={option.title} style={option.style} > {option.label} diff --git a/package.json b/package.json index 4b65da9ccdd4..544f36c3db65 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "dayjs": "^1.11.1", "qrcode.react": "^3.1.0", "rc-cascader": "~3.12.0", - "rc-checkbox": "~3.0.0", + "rc-checkbox": "~3.1.0", "rc-collapse": "~3.7.0", "rc-dialog": "~9.1.0", "rc-drawer": "~6.2.0",