Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ type OmitPanelProps<Props> = Omit<
'onChange' | 'hideHeader' | 'pickerValue' | 'onPickerValueChange'
>;

export type PickerBaseProps<DateType> = {} & PickerSharedProps<DateType> & OmitPanelProps<PickerPanelBaseProps<DateType>>;
export type PickerBaseProps<DateType> = {} & PickerSharedProps<DateType> &
OmitPanelProps<PickerPanelBaseProps<DateType>>;

export type PickerDateProps<DateType> = {} & PickerSharedProps<DateType> & OmitPanelProps<PickerPanelDateProps<DateType>>;
export type PickerDateProps<DateType> = {} & PickerSharedProps<DateType> &
OmitPanelProps<PickerPanelDateProps<DateType>>;

export type PickerTimeProps<DateType> = {
picker: 'time';
Expand All @@ -109,7 +111,8 @@ export type PickerTimeProps<DateType> = {
* since `defaultOpenValue` will confuse user of current value status
*/
defaultOpenValue?: DateType;
} & PickerSharedProps<DateType> & Omit<OmitPanelProps<PickerPanelTimeProps<DateType>>, 'format'>;
} & PickerSharedProps<DateType> &
Omit<OmitPanelProps<PickerPanelTimeProps<DateType>>, 'format'>;

export type PickerProps<DateType> =
| PickerBaseProps<DateType>
Expand Down Expand Up @@ -194,9 +197,8 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
const [selectedValue, setSelectedValue] = React.useState<DateType | null>(mergedValue);

// Operation ref
const operationRef: React.MutableRefObject<ContextOperationRefProps | null> = React.useRef<ContextOperationRefProps>(
null,
);
const operationRef: React.MutableRefObject<ContextOperationRefProps | null> =
React.useRef<ContextOperationRefProps>(null);

// Open
const [mergedOpen, triggerInnerOpen] = useMergedState(false, {
Expand Down Expand Up @@ -433,6 +435,7 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
triggerOpen(false);
}}
className={`${prefixCls}-clear`}
role="button"
>
{clearIcon || <span className={`${prefixCls}-clear-btn`} />}
</span>
Expand Down
1 change: 1 addition & 0 deletions tests/__snapshots__/picker.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ exports[`Picker.Basic icon 1`] = `
</span>
<span
class="rc-picker-clear"
role="button"
>
<span
class="suffix-icon"
Expand Down