From a48bc3c466d5053a355778e4078af3f93634e01c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Wed, 19 Oct 2022 10:30:22 +0800 Subject: [PATCH 1/3] fix: input-number & mention text color not follow theme change (#38087) --- components/input-number/style/index.tsx | 1 + components/mentions/style/index.tsx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/components/input-number/style/index.tsx b/components/input-number/style/index.tsx index f78f292fd6..c01390f0b6 100644 --- a/components/input-number/style/index.tsx +++ b/components/input-number/style/index.tsx @@ -153,6 +153,7 @@ const genInputNumberStyles: GenerateStyle = (token: InputNumbe outline: 0, transition: `all ${motionDurationFast} linear`, appearance: 'textfield', + color: token.colorText, ...genPlaceholderStyle(token.colorTextPlaceholder), '&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button': diff --git a/components/mentions/style/index.tsx b/components/mentions/style/index.tsx index a2848308b5..08d57fb5ac 100644 --- a/components/mentions/style/index.tsx +++ b/components/mentions/style/index.tsx @@ -80,6 +80,8 @@ const genMentionsStyle: GenerateStyle = token => { // ================= Input Area ================= [`> textarea, ${componentCls}-measure`]: { + color: colorText, + boxSizing: 'border-box', minHeight: controlHeight - 2, margin: 0, padding: `${inputPaddingVertical}px ${inputPaddingHorizontal}px`, From 2453e2174417a3174a6f48fee6e32d0a47acfcba Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Fri, 21 Oct 2022 10:16:03 +0800 Subject: [PATCH 2/3] fix: modal footer should be hidden if null (#38138) --- components/modal/PurePanel.tsx | 40 +++++++++---------- components/modal/__tests__/Modal.test.tsx | 5 +++ .../__snapshots__/Modal.test.tsx.snap | 20 ---------- components/popconfirm/style/index.tsx | 2 +- 4 files changed, 26 insertions(+), 41 deletions(-) diff --git a/components/modal/PurePanel.tsx b/components/modal/PurePanel.tsx index aa3db8a2d2..a04d6a68de 100644 --- a/components/modal/PurePanel.tsx +++ b/components/modal/PurePanel.tsx @@ -54,26 +54,26 @@ export function renderFooter( footer, } = props; - return ( - footer ?? ( - - {locale => ( - <> - - - - )} - - ) + return footer === undefined ? ( + + {locale => ( + <> + + + + )} + + ) : ( + footer ); } diff --git a/components/modal/__tests__/Modal.test.tsx b/components/modal/__tests__/Modal.test.tsx index 69d27b5948..6d52fee427 100644 --- a/components/modal/__tests__/Modal.test.tsx +++ b/components/modal/__tests__/Modal.test.tsx @@ -105,4 +105,9 @@ describe('Modal', () => { errSpy.mockRestore(); }); + + it('should not render footer if null', () => { + const { container } = render(); + expect(container.querySelector('.ant-modal-footer')).toBeFalsy(); + }); }); diff --git a/components/modal/__tests__/__snapshots__/Modal.test.tsx.snap b/components/modal/__tests__/__snapshots__/Modal.test.tsx.snap index fa50aedad9..a338796b52 100644 --- a/components/modal/__tests__/__snapshots__/Modal.test.tsx.snap +++ b/components/modal/__tests__/__snapshots__/Modal.test.tsx.snap @@ -155,26 +155,6 @@ exports[`Modal render without footer 1`] = ` > Here is content of Modal -