Skip to content

Commit

Permalink
fix(time-picker): 修复设置空字符串无效问题 (#2837)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyprepare committed May 28, 2024
1 parent 8c21a52 commit 494ebd9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/beige-actors-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/hiui": patch
---

fix(time-picker): 修复设置空字符串无效问题
5 changes: 5 additions & 0 deletions .changeset/dry-jokes-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/time-picker": patch
---

fix: 修复设置空字符串无效问题
2 changes: 1 addition & 1 deletion packages/ui/time-picker/src/TimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 494ebd9

Please sign in to comment.