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]