diff --git a/src/PickerInput/Popup/Footer.tsx b/src/PickerInput/Popup/Footer.tsx index 63ad5e43b..79b948955 100644 --- a/src/PickerInput/Popup/Footer.tsx +++ b/src/PickerInput/Popup/Footer.tsx @@ -107,7 +107,7 @@ export default function Footer(props: FooterProps) { return (
- {extraNode} + {extraNode &&
{extraNode}
} {rangeNode}
); diff --git a/src/utils/getExtraFooter.tsx b/src/utils/getExtraFooter.tsx deleted file mode 100644 index af54e15d3..000000000 --- a/src/utils/getExtraFooter.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react'; -import type { PanelMode } from '../interface'; - -export default function getExtraFooter( - prefixCls: string, - mode: PanelMode, - renderExtraFooter?: (mode: PanelMode) => React.ReactNode, -) { - if (!renderExtraFooter) { - return null; - } - - return ( -
{renderExtraFooter(mode)}
- ); -} diff --git a/tests/picker.spec.tsx b/tests/picker.spec.tsx index 3ff310bb5..1dc33104e 100644 --- a/tests/picker.spec.tsx +++ b/tests/picker.spec.tsx @@ -498,7 +498,7 @@ describe('Picker.Basic', () => { ); function matchFooter(mode: string) { - expect(document.querySelector('.rc-picker-footer').textContent).toEqual(mode); + expect(document.querySelector('.rc-picker-footer-extra').textContent).toEqual(mode); expect(renderExtraFooter.mock.calls[renderExtraFooter.mock.calls.length - 1][0]).toEqual( mode, ); diff --git a/tests/range.spec.tsx b/tests/range.spec.tsx index fe1eb7e27..ddb8cb0bb 100644 --- a/tests/range.spec.tsx +++ b/tests/range.spec.tsx @@ -144,7 +144,7 @@ describe('Picker.Range', () => {

footer

} picker="year" />, ); openPicker(container); - expect(document.querySelector('.rc-picker-footer').textContent).toEqual('footer'); + expect(document.querySelector('.rc-picker-footer-extra').textContent).toEqual('footer'); expect(document.querySelectorAll('.rc-picker-header-view')[0].textContent).toEqual( '1990年-1999年', );