Browse Source

fix: Radio.Button title loss (#43012)

pull/43027/head
daisy 1 year ago
committed by GitHub
parent
commit
e9bbc588cd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      components/checkbox/Checkbox.tsx
  2. 2
      components/checkbox/Group.tsx
  3. 1
      components/radio/group.tsx
  4. 2
      package.json

5
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<T> {
checked?: boolean;
style?: React.CSSProperties;
disabled?: boolean;
title?: string;
onChange?: (e: T) => void;
onClick?: React.MouseEventHandler<HTMLElement>;
onMouseEnter?: React.MouseEventHandler<HTMLElement>;

2
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<HTMLDivElement, Chec
onChange={option.onChange}
className={`${groupPrefixCls}-item`}
style={option.style}
title={option.title}
>
{option.label}
</Checkbox>

1
components/radio/group.tsx

@ -76,6 +76,7 @@ const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>((props, ref
disabled={option.disabled || disabled}
value={option.value}
checked={value === option.value}
title={option.title}
style={option.style}
>
{option.label}

2
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",

Loading…
Cancel
Save