Skip to content

Commit 85de7b3

Browse files
authored
fix: escape quote (#223)
1 parent eb4fd0f commit 85de7b3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmdk/src/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,9 @@ const Command = React.forwardRef<HTMLDivElement, CommandProps>((props, forwarded
399399
groups
400400
.sort((a, b) => b[1] - a[1])
401401
.forEach((group) => {
402-
const element = listInnerRef.current.querySelector(`${GROUP_SELECTOR}[${VALUE_ATTR}="${group[0]}"]`)
402+
const element = listInnerRef.current.querySelector(
403+
`${GROUP_SELECTOR}[${VALUE_ATTR}="${encodeURIComponent(group[0])}"]`,
404+
)
403405
element?.parentElement.appendChild(element)
404406
})
405407
}

0 commit comments

Comments
 (0)