From f0726014c3405480b4590d0ec1567aa928905b2e Mon Sep 17 00:00:00 2001 From: shao Date: Tue, 30 Jul 2019 20:57:39 +0800 Subject: [PATCH 1/2] fix(Form.Item): fix label replace regexp err replace --- components/form/FormItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index 98bc00a208..22e163e5e7 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -357,7 +357,7 @@ export default class FormItem extends React.Component { const haveColon = computedColon && !vertical; // Remove duplicated user input colon if (haveColon && typeof label === 'string' && (label as string).trim() !== '') { - labelChildren = (label as string).replace(/[:|:]\s*$/, ''); + labelChildren = (label as string).replace(/(:|:)\s*$/, ''); } const labelClassName = classNames({ From 27e7e33d129a7c78fa10a509e01e32f5412003df Mon Sep 17 00:00:00 2001 From: shao Date: Wed, 31 Jul 2019 11:12:31 +0800 Subject: [PATCH 2/2] fix review change --- components/form/FormItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index 22e163e5e7..2d78850c7a 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -357,7 +357,7 @@ export default class FormItem extends React.Component { const haveColon = computedColon && !vertical; // Remove duplicated user input colon if (haveColon && typeof label === 'string' && (label as string).trim() !== '') { - labelChildren = (label as string).replace(/(:|:)\s*$/, ''); + labelChildren = (label as string).replace(/[::]\s*$/, ''); } const labelClassName = classNames({