Skip to content

Commit

Permalink
fix: Radio.Button title loss
Browse files Browse the repository at this point in the history
  • Loading branch information
linxianxi committed Jun 15, 2023
1 parent b72d313 commit 218defe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions components/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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>;
Expand Down
2 changes: 2 additions & 0 deletions components/checkbox/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface CheckboxOptionType {
value: CheckboxValueType;
style?: React.CSSProperties;
disabled?: boolean;
title?: string;
onChange?: (e: CheckboxChangeEvent) => void;
}

Expand Down Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions components/radio/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 218defe

Please sign in to comment.