N'enregistre pas les string vide dans useSelection

pull/2105/head
Jérémy Rialland 2022-04-21 13:22:02 +02:00 committed by Johan Girod
parent 1bf19e3209
commit efc422609a
1 changed files with 3 additions and 0 deletions

View File

@ -256,6 +256,9 @@ export function useSelection<Names extends string = DottedName>({
const handleChange = useCallback(
(val: Key) => {
val = val.toString()
if (!val.length) {
return
}
setCurrentSelection(val)
debounce.current != null && clearTimeout(debounce.current)