Skip to content

Commit 1043316

Browse files
hlomzikAndrejOroscursoragent
authored
fix: BROS-843: Fix hotkey styles in tooltips (#9575)
Co-authored-by: AndrejOros <andrej.oros@heartex.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: AndrejOros <AndrejOros@users.noreply.github.com>
1 parent 4e8e62b commit 1043316

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

web/libs/editor/src/components/App/App.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ body {
9191
}
9292

9393
.key-group {
94+
display: inline-flex;
95+
align-items: center;
96+
9497
&__key {
9598
padding: 0 4px;
9699
height: 16px;

web/libs/editor/src/core/Hotkey.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -462,15 +462,21 @@ Hotkey.Tooltip = inject("store")(
462462

463463
if (enabled) {
464464
shortcut.split(",").forEach((combination: string) => {
465-
const keys = combination.split("+").map((key: string) =>
466-
createElement(
467-
"kbd",
468-
{
469-
className: cn("hotkey").elem("key").toClassName(),
470-
},
471-
key,
472-
),
473-
);
465+
const keyParts = combination.split("+");
466+
const keys: JSX.Element[] = [];
467+
468+
keyParts.forEach((key: string, i: number) => {
469+
keys.push(
470+
createElement(
471+
"kbd",
472+
{
473+
className: cn("key-group").elem("key").toClassName(),
474+
key: `key-${i}`,
475+
},
476+
key,
477+
),
478+
);
479+
});
474480

475481
hotkeys.push(
476482
createElement(

0 commit comments

Comments
 (0)