Skip to content

fix(Link): prevent text selection on icon element - #3051

Merged
Lisa18289 merged 3 commits into
mainfrom
prevent-text-selection-of-icon-in-link
Sep 2, 2026
Merged

fix(Link): prevent text selection on icon element#3051
Lisa18289 merged 3 commits into
mainfrom
prevent-text-selection-of-icon-in-link

Conversation

@TimAufdemKampe

Copy link
Copy Markdown
Member

No description provided.

@TimAufdemKampe
TimAufdemKampe requested a review from a team September 1, 2026 12:32
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 78.69% 746 / 948
🔵 Statements 78.57% 763 / 971
🔵 Functions 80.09% 165 / 206
🔵 Branches 70.33% 377 / 536
File CoverageNo changed files found.
Generated in workflow #6523 for commit d0f994d by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

Preview environments are ready:

Type URL
docs pr-3051.docs.review.flow-components.de
storybook pr-3051.storybook.review.flow-components.de

Images:

  • docs: ghcr.io/mittwald/flow/docs:pr-3051
  • storybook: ghcr.io/mittwald/flow/storybook:pr-3051

@Lisa18289

Copy link
Copy Markdown
Member

I can't reproduce the effect — as far as I can measure, the rule does nothing.

Dragging a selection over the link behaves identically with and without it in all three engines: same selected text, pixel-identical highlight. Which makes sense — the icon is an inline SVG with no text in it, so there's nothing to select there.

What does get selected is the zero-width joiner that LinkIcon renders next to the icon: copying a link with target="_blank" gives you mittwald.de plus an invisible U+200D. If that's what bothered you, the rule would have to go on .linkIcon (the wrapping ) instead of .icon (the svg).

Whichever way it goes, we'd like a test for it. A visual test won't help — selection isn't captured in a screenshot — so a *.browser.test.tsx asserting the computed style, or the selected text after a drag, is the way to cover this.

What did you actually observe? No issue is linked, so I might be testing the wrong thing.

@TimAufdemKampe
TimAufdemKampe force-pushed the prevent-text-selection-of-icon-in-link branch 2 times, most recently from d5657c5 to 6949de8 Compare September 2, 2026 06:59
@TimAufdemKampe
TimAufdemKampe force-pushed the prevent-text-selection-of-icon-in-link branch from 6949de8 to 39cf515 Compare September 2, 2026 07:07
Lisa18289
Lisa18289 previously approved these changes Sep 2, 2026
# Conflicts:
#	packages/components/src/components/Link/Link.browser.test.tsx
@Lisa18289
Lisa18289 merged commit 9f3160b into main Sep 2, 2026
22 checks passed
@Lisa18289
Lisa18289 deleted the prevent-text-selection-of-icon-in-link branch September 2, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants