fix tags input returns [""] instead of [] when empty
This commit is contained in:
@@ -65,6 +65,9 @@ function _TagsInput({ ref }: { ref: React.Ref<TagsInputRef> }) {
|
|||||||
|
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
get tags() {
|
get tags() {
|
||||||
|
if (value === "") {
|
||||||
|
return []
|
||||||
|
}
|
||||||
return value.trim().split(" ")
|
return value.trim().split(" ")
|
||||||
},
|
},
|
||||||
input: refs.reference.current,
|
input: refs.reference.current,
|
||||||
|
Reference in New Issue
Block a user