Skip to content

Fix: Allow triple-click text selection to flow around pills #30349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

AlirezaMrtz
Copy link
Contributor

@AlirezaMrtz AlirezaMrtz commented Jul 20, 2025

Fixes #30296

Fixes an issue where triple clicking to select message text would stop at pills instead of selecting the entire line.

Changes made:

  • Changed .mx_Pill display from inline-flex to inline to allow proper text flow
  • Added user-select: text to .mx_BaseAvatar to ensure avatars don't block selection
  • Adjusted avatar vertical alignment with vertical-align: -2.5px to maintain visual consistency

Before/After

Before: Triple clicking a message line would stop selection at pill boundaries
After: Triple clicking selects the entire message line as expected

Testing Strategy

  1. Find any message containing a pill (keyword pill, user pill, message pill, room pill, etc.)
  2. Triple click on the message line
  3. Verify that the entire line is selected, not just text up to the pill

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • I have licensed the changes to Element by completing the Contributor License Agreement (CLA)

@dbkr
Copy link
Member

dbkr commented Jul 21, 2025

  • Changing the alignment was necessary to compensate for the change from inline-flex to inline?
  • What is 'allow proper text flow' - is this related to the triple click selection or a different fix?
  • A test of some kind would be great for this, otherwise it's just going to get broken again.
  • You also have some other end to end test failures.

@MidhunSureshR
Copy link
Member

MidhunSureshR commented Jul 21, 2025

Your test failures are mostly because you did not update the screenshots. I'm not sure if you really intended to change the size of the pill, if you did, you need to run yarn test:playwright:screenshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New keyword pills make text unselectable
3 participants