Skip to content

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.

@AlirezaMrtz
Copy link
Contributor Author

AlirezaMrtz commented Aug 12, 2025

* Changing the alignment was necessary to compensate for the change from inline-flex to inline?

Yes, changing to inline-block caused the avatar to shift vertically since we no longer get align-items: center from inline-flex. The vertical-align: -2.5px was added to visually match the previous centering and maintain the same appearance.

* What is 'allow proper text flow' - is this related to the triple click selection or a different fix?

It is related to the triple click selection. I mean maintaining text continuity so that triple click selection works as users expect.

* You also have some other end to end test failures.

I solved them by changing inline to inline-block.

@AlirezaMrtz
Copy link
Contributor Author

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.

I didn’t intend to change the pill size. I changed inline to inline-block, and with that change the tests still pass using the existing screenshots.

@dbkr
Copy link
Member

dbkr commented Aug 26, 2025

Thanks for fixing the tests. Ideally this would also add a test for the triple click behaviour so that doesn't regress, if possible?

@AlirezaMrtz
Copy link
Contributor Author

Thanks for fixing the tests. Ideally this would also add a test for the triple click behaviour so that doesn't regress, if possible?

Added a test for it.

@dbkr
Copy link
Member

dbkr commented Aug 27, 2025

That's great, thank you!

@dbkr dbkr added this pull request to the merge queue Aug 27, 2025
Merged via the queue into element-hq:develop with commit a112dfe Aug 27, 2025
31 checks passed
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