Skip to content

Commit

Permalink
fix(past-time-picker): visible change & disabled style (#1541)
Browse files Browse the repository at this point in the history
Co-authored-by: ZhaoChen <ittisennsinn@gmail.com>
  • Loading branch information
itiiss and itiisennsinn committed Nov 29, 2021
1 parent 851403c commit 7cdd93a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/date-picker/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,20 @@ export const DatePicker: React.FC<DatePickerProps> = (props: DatePickerProps) =>
suffix={suffix}
className={className}
style={style}
onClick={() => setVisible(!visible)}
/>
);
}

return (
<Popover
content={content}
trigger={['click', 'focus']}
trigger="click"
visible={visible}
placement="bottomLeft"
overlayClassName={overlayCls}
onVisibleChange={handleVisibleChange}
disabled={disabled}
{...restProps}
>
{renderTrigger()}
Expand Down
4 changes: 3 additions & 1 deletion src/date-range-picker/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ export const DateRangePicker: React.FC<DateRangePickerProps> = (props: DateRange
suffix={suffix}
className={className}
style={style}
onClick={() => setVisible(!visible)}
/>
);
}

return (
<Popover
content={content}
trigger={['click', 'focus']}
disabled={disabled}
trigger="click"
visible={visible}
placement="bottomLeft"
overlayClassName={overlayCls}
Expand Down
4 changes: 3 additions & 1 deletion src/past-time-picker/PastTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,20 @@ const PastTimePicker = (props: PastTimePickerProps) => {
suffix={suffix}
className={className}
style={style}
onClick={() => setControlledVisible(!controlledVisible)}
/>
);
}

return (
<Popover
content={content()}
trigger={['click', 'focus']}
trigger="click"
visible={controlledVisible}
placement="bottomLeft"
overlayClassName={overlayCls}
onVisibleChange={handleVisibleChange}
disabled={disabled}
{...restProps}
>
{renderTrigger()}
Expand Down
2 changes: 1 addition & 1 deletion src/static-date-picker/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@
}

&-disabled {
color: @gray-3;
cursor: not-allowed;
pointer-events: none;

&::before {
background: @palette-gray-1;
Expand Down

1 comment on commit 7cdd93a

@vercel
Copy link

@vercel vercel bot commented on 7cdd93a Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.