Skip to content

Commit 05199cb

Browse files
authored
Fix bug with backspacing (#176)
1 parent 5c24283 commit 05199cb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmdk/src/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,8 +971,11 @@ function useValue(
971971
return part.trim().toLowerCase()
972972
}
973973

974-
if (typeof part === 'object' && 'current' in part && part.current) {
975-
return part.current.textContent?.trim().toLowerCase()
974+
if (typeof part === 'object' && 'current' in part) {
975+
if (part.current) {
976+
return part.current.textContent?.trim().toLowerCase()
977+
}
978+
return valueRef.current
976979
}
977980
}
978981
})()

0 commit comments

Comments
 (0)