fix(snapshot): keep the selection bar off Android's own menu - #6640
Closed
tomeredlich wants to merge 1 commit into
Closed
fix(snapshot): keep the selection bar off Android's own menu#6640tomeredlich wants to merge 1 commit into
tomeredlich wants to merge 1 commit into
Conversation
The platform draws its Copy/Share menu above a selection whenever there is room, which is the slot the bar was picking too. Preferring the other side on a coarse pointer anti-correlates the two: Android only moves below the quote when there is no room above, and that is the case where the bar goes above. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
Folded into #6638 — same file, same feature, easier to review as one. |
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
On Android, Chrome's native selection menu (Copy / Share / Select all) renders over our selection bar — see the report: both land in the space above the highlighted text.
That menu is browser chrome, not our DOM. There is no event to cancel and no CSS to suppress it; the only thing that removes it is
user-select: none, which would also remove the selection the feature is built on. So this avoids the collision instead of hiding the menu.Change
On a coarse pointer, the bar prefers the space below the selection, clearing the drag handles Android hangs under it. This anti-correlates the two: the platform menu only moves below the quote when there is no room above, and that is exactly the case where our bar goes above. Mouse placement is unchanged.
Verification
packages/sharedsnapshot suites: 7 suites / 44 tests pass, including a new case asserting the bar sits below the quote under(pointer: coarse).Worth a real-device check on the preview before merge — the handle clearance is a fixed 32px and Android's handle size varies with display density.
🤖 Generated with Claude Code
Preview domain
https://claude-android-selection-bar-ove.preview.app.daily.dev