Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Radio.Button title loss #43012

Merged
merged 1 commit into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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}
linxianxi marked this conversation as resolved.
Show resolved Hide resolved
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