diff --git a/packages/docsearch-css/src/button.css b/packages/docsearch-css/src/button.css
index 1defba7ea..32185defe 100644
--- a/packages/docsearch-css/src/button.css
+++ b/packages/docsearch-css/src/button.css
@@ -43,6 +43,7 @@
.DocSearch-Button-Keys {
display: flex;
+ min-width: calc(2 * 20px + 2 * 0.4em);
}
.DocSearch-Button-Key {
@@ -62,11 +63,7 @@
}
@media (max-width: 750px) {
- .DocSearch-Button-KeySeparator,
- .DocSearch-Button-Key {
- display: none;
- }
-
+ .DocSearch-Button-Keys,
.DocSearch-Button-Placeholder {
display: none;
}
diff --git a/packages/docsearch-react/src/DocSearchButton.tsx b/packages/docsearch-react/src/DocSearchButton.tsx
index 5d5085103..19d2eb960 100644
--- a/packages/docsearch-react/src/DocSearchButton.tsx
+++ b/packages/docsearch-react/src/DocSearchButton.tsx
@@ -47,14 +47,16 @@ export const DocSearchButton = React.forwardRef<
{buttonText}
- {key !== null && (
-
-
- {key === ACTION_KEY_DEFAULT ? : key}
-
- K
-
- )}
+
+ {key !== null && (
+ <>
+
+ {key === ACTION_KEY_DEFAULT ? : key}
+
+ K
+ >
+ )}
+
);
});