fix(desktop): resolve composer cursor drift on multi-line input#153
Merged
wesbillman merged 1 commit intomainfrom Mar 21, 2026
Merged
fix(desktop): resolve composer cursor drift on multi-line input#153wesbillman merged 1 commit intomainfrom
wesbillman merged 1 commit intomainfrom
Conversation
The base Textarea component's md:text-sm responsive class was overriding the composer's leading-6 line-height at md+ breakpoints, causing a 4px per-line drift between the textarea caret and the mention overlay text. Adding md:leading-6 ensures consistent 24px line-height at all breakpoints.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When typing multi-line text in the message composer, the cursor drifts upward from the actual text position. By the 3rd line, the cursor is ~12px above where the text appears, making it difficult to see what you're typing.
Root Cause
The base
Textareacomponent (shared/ui/textarea.tsx) includesmd:text-smin its default classes. At themdbreakpoint,md:text-smsets bothfont-size: 0.875remandline-height: 1.25rem(20px). The composer overrides withleading-6(24px line-height), but the responsivemd:text-smhas higher CSS specificity and wins at desktop widths.Meanwhile, the
ComposerMentionOverlay(a plain<div>) usestext-sm leading-6without any responsive override, so it keepsline-height: 24pxat all breakpoints.This mismatch — textarea at 20px vs overlay at 24px — causes the caret to drift 4px per line away from the overlay's visible text.
Fix
Add
md:leading-6to the Textarea className inMessageComposer.tsxso the line-height override wins at themdbreakpoint too. This ensures both the textarea and overlay use a consistent 24px line-height at all breakpoints.Follow-up (separate PR)
lineHeightRefwith a constant (24px at all breakpoints now)md:leading-6to the overlay for symmetry