Skip to content

Commit d0550ce

Browse files
akoremangethinwebster
authored andcommitted
fix: make line numbers unselectable
1 parent a6277a0 commit d0550ce

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/code-view/internal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function InternalCodeView({
5656
return (
5757
<tr key={index}>
5858
{lineNumbers && (
59-
<td className={styles["line-number"]} aria-hidden={true}>
59+
<td className={clsx(styles["line-number"], styles.unselectable)} aria-hidden={true}>
6060
<Box color="text-status-inactive" fontSize="body-m">
6161
{index + 1}
6262
</Box>

src/code-view/styles.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ $color-background-code-view-dark: #282c34;
4141
padding-right: cs.$space-static-xs;
4242
}
4343

44+
.unselectable {
45+
-webkit-user-select: none;
46+
user-select: none;
47+
}
48+
4449
.code-line {
4550
padding-left: cs.$space-static-xs;
4651
padding-right: cs.$space-static-xs;

0 commit comments

Comments
 (0)