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: ok button of the DatePicker becomes compacted when used with Space.Compact #46769

Merged
merged 7 commits into from
Jan 16, 2024
Merged
4 changes: 3 additions & 1 deletion components/date-picker/PickerButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ import type { ButtonProps } from '../button';
import Button from '../button';

export default function PickerButton(props: ButtonProps) {
return <Button size="small" type="primary" {...props} />;
// add unCompact class to the button to ensure it's un-compacted
// when used with Space.Compact
return <Button size="small" type="primary" className="unCompact" {...props} />;
}
11 changes: 6 additions & 5 deletions components/style/compact-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,20 @@ function compactItemBorderRadius(
const childCombinator = borderElCls ? `> ${borderElCls}` : '';

return {
[`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item) ${childCombinator}`]: {
borderRadius: 0,
},
[`&-item:not(.unCompact):not(${parentCls}-first-item):not(${parentCls}-last-item) ${childCombinator}`]:
{
borderRadius: 0,
},
Fatpandac marked this conversation as resolved.
Show resolved Hide resolved

[`&-item:not(${parentCls}-last-item)${parentCls}-first-item`]: {
[`&-item:not(.unCompact):not(${parentCls}-last-item)${parentCls}-first-item`]: {
[`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]:
{
borderStartEndRadius: 0,
borderEndEndRadius: 0,
},
},

[`&-item:not(${parentCls}-first-item)${parentCls}-last-item`]: {
[`&-item:not(.unCompact):not(${parentCls}-first-item)${parentCls}-last-item`]: {
[`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]:
{
borderStartStartRadius: 0,
Expand Down