From 494ebd982d50a1bc57697effd8365adfa2d37132 Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Tue, 28 May 2024 17:40:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(time-picker):=20=E4=BF=AE=E5=A4=8D=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=A9=BA=E5=AD=97=E7=AC=A6=E4=B8=B2=E6=97=A0=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#2837)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/beige-actors-push.md | 5 +++++ .changeset/dry-jokes-work.md | 5 +++++ packages/ui/time-picker/src/TimePicker.tsx | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/beige-actors-push.md create mode 100644 .changeset/dry-jokes-work.md diff --git a/.changeset/beige-actors-push.md b/.changeset/beige-actors-push.md new file mode 100644 index 000000000..1709f1a2c --- /dev/null +++ b/.changeset/beige-actors-push.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +fix(time-picker): 修复设置空字符串无效问题 diff --git a/.changeset/dry-jokes-work.md b/.changeset/dry-jokes-work.md new file mode 100644 index 000000000..c74032212 --- /dev/null +++ b/.changeset/dry-jokes-work.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/time-picker": patch +--- + +fix: 修复设置空字符串无效问题 diff --git a/packages/ui/time-picker/src/TimePicker.tsx b/packages/ui/time-picker/src/TimePicker.tsx index 115cd74c3..78758c806 100644 --- a/packages/ui/time-picker/src/TimePicker.tsx +++ b/packages/ui/time-picker/src/TimePicker.tsx @@ -32,7 +32,7 @@ const getValueMatchString = ( value?: TimePickerValue[] | TimePickerValue, format: TimePickerFormat = 'HH:mm:ss' ) => { - if (!value) { + if (value === undefined || value === null) { return undefined } const result = Array.isArray(value) ? value : [value]