Add comment about returnFocus

This commit is contained in:
Koen Vlaswinkel
2024-02-07 14:22:47 +01:00
parent b74306249e
commit fdb4d42bf3

View File

@@ -243,6 +243,11 @@ export const SuggestBox = <
context={context}
initialFocus={-1}
visuallyHiddenDismiss
// The default for returnFocus is true, but this doesn't work when opening
// the command palette in a VS Code webview. The focus is returned to the
// input element, but this closes the command palette immediately after opening
// it. By setting returnFocus to false, the focus is not immediately given to
// the input element, so the command palette stays open.
returnFocus={false}
>
<ListContainer