Skip to content

Commit f6eb1d5

Browse files
authored
Fix double/triple click selection issues for heading with a clickable anchor link (#3140)
1 parent dc8b6d5 commit f6eb1d5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/clean-yaks-drive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/starlight': patch
3+
---
4+
5+
Fixes a text selection issue for heading with a clickable anchor link when using double or triple click to select text.

packages/starlight/style/anchor-links.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ how we do it.
8888
position: relative;
8989
/* Move the anchor link over the heading element’s end-of-line padding. */
9090
margin-inline-start: calc(-1 * var(--sl-anchor-icon-size));
91+
/* Prevent double or triple clicks from potentially selecting the anchor link a11y text. */
92+
-webkit-user-select: none;
93+
user-select: none;
9194
}
9295

9396
/* Increase clickable area for anchor links with a pseudo element that doesn’t impact layout. */

0 commit comments

Comments
 (0)