diff --git a/src/PickerInput/Popup/PopupPanel.tsx b/src/PickerInput/Popup/PopupPanel.tsx index 1c48c413a..94cfccc4f 100644 --- a/src/PickerInput/Popup/PopupPanel.tsx +++ b/src/PickerInput/Popup/PopupPanel.tsx @@ -61,6 +61,8 @@ export default function PopupPanel( }, }; + const hideHeader = picker === 'time'; + // ====================== Limitation ====================== const needLimit = React.useCallback( (currentPickerValue: DateType) => { @@ -96,6 +98,7 @@ export default function PopupPanel( ...props, hoverValue: null, hoverRangeValue: null, + hideHeader, }; if (range) { diff --git a/src/PickerPanel/context.ts b/src/PickerPanel/context.ts index 9a42cd593..bda5c26f0 100644 --- a/src/PickerPanel/context.ts +++ b/src/PickerPanel/context.ts @@ -104,3 +104,7 @@ export interface PickerHackContextProps { * Internal usage for RangePicker to not to show the operation arrow */ export const PickerHackContext = React.createContext({}); + +if (process.env.NODE_ENV !== 'production') { + PickerHackContext.displayName = 'PickerHackContext'; +} diff --git a/tests/picker.spec.tsx b/tests/picker.spec.tsx index 1dc33104e..c36b0949a 100644 --- a/tests/picker.spec.tsx +++ b/tests/picker.spec.tsx @@ -605,7 +605,10 @@ describe('Picker.Basic', () => { it('time should display now', () => { const onCalendarChange = jest.fn(); const { container } = render(); + openPicker(container); + expect(document.querySelector('.rc-picker-header')).toBeFalsy(); + fireEvent.click(document.querySelector('.rc-picker-now > a')); expect(