From 1f3fec9342e1e6fa52e8e6169f8e264dbfb8983a Mon Sep 17 00:00:00 2001 From: Schalk Bezuidenhout Date: Thu, 9 Jan 2025 10:39:04 +0200 Subject: [PATCH] Update index.tsx Added a check whether .trim() is a function/method of value. This solves an error where the value is a number. --- cmdk/src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdk/src/index.tsx b/cmdk/src/index.tsx index 86a55a2..6a23bb9 100644 --- a/cmdk/src/index.tsx +++ b/cmdk/src/index.tsx @@ -221,7 +221,7 @@ const Command = React.forwardRef((props, forwarded /** Controlled mode `value` handling. */ useLayoutEffect(() => { if (value !== undefined) { - const v = value.trim() + const v = value.trim?.() state.current.value = v store.emit() }