From 0acb9901eaacbc8992ed9cce9d953d6bc0b95634 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 7 Mar 2022 12:22:33 +0800 Subject: [PATCH 1/7] fix: Form.Item "React does not recognize the requiredMark prop on a DOM element" (#34323) close #34310 --- components/form/FormItem.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index d879c2cab0..d8395ba358 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -261,6 +261,7 @@ function FormItem(props: FormItemProps): React.ReactElemen 'colon', 'extra', 'fieldKey', + 'requiredMark', 'getValueFromEvent', 'getValueProps', 'htmlFor', From 8d7f137a09d2d463360db0ca0c8abc52f94f77af Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Mon, 7 Mar 2022 13:09:07 +0800 Subject: [PATCH 2/7] test: add boolean value input test (#34324) --- components/input/__tests__/index.test.js | 7 +++++++ components/input/__tests__/textarea.test.js | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/components/input/__tests__/index.test.js b/components/input/__tests__/index.test.js index 42f33c240d..2e661fb892 100644 --- a/components/input/__tests__/index.test.js +++ b/components/input/__tests__/index.test.js @@ -373,4 +373,11 @@ describe('Input allowClear', () => { const wrapper = mount(); expect(wrapper).toBeTruthy(); }); + + it('should display boolean value as string', () => { + const wrapper = mount(); + expect(wrapper.find('input').first().getDOMNode().value).toBe('true'); + wrapper.setProps({ value: false }); + expect(wrapper.find('input').first().getDOMNode().value).toBe('false'); + }); }); diff --git a/components/input/__tests__/textarea.test.js b/components/input/__tests__/textarea.test.js index 320d29f872..f2867a2702 100644 --- a/components/input/__tests__/textarea.test.js +++ b/components/input/__tests__/textarea.test.js @@ -509,4 +509,11 @@ describe('TextArea allowClear', () => { expect(document.activeElement).toBe(wrapper.find('textarea').at(0).getDOMNode()); wrapper.unmount(); }); + + it('should display boolean value as string', () => { + const wrapper = mount(