Position the editor caret against its overlay root - #64
Merged
MatteoGauthier merged 4 commits intoSep 25, 2026
Merged
MatteoGauthier merged 4 commits into
MatteoGauthier merged 4 commits into
Conversation
- Anchor the caret absolutely to the overlay so a filtered or transformed ancestor is not its containing block. - Subtract the overlay origin from the caret rect in the same scheduled measure.
- Record readCaretRect on the unscheduled-measure allowlist because GeometryReader does not own the overlay box. - Normalize the neighboring allowlist entry to spaces.
- Stub a non-zero overlay origin and assert absolute left and top offsets.
- State in the React spec that filtered or transformed ancestors do not become the caret's containing block. - Add a patch changeset for @input/pen-react.
Member
Author
|
bugbot run |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 6197b8c. Configure here.
MatteoGauthier
marked this pull request as ready for review
September 24, 2026 14:24
MatteoGauthier
requested review from
janglad,
krijnrijshouwer and
noudadrichem
September 24, 2026 14:24
janglad
approved these changes
Sep 24, 2026
krijnrijshouwer
approved these changes
Sep 25, 2026
noudadrichem
approved these changes
Sep 25, 2026
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.
Note
Low Risk
Localized caret overlay layout change with updated unit tests; no auth, data, or document-model impact.
Overview
Fixes the custom editor caret disappearing in modals and other hosts where filtered or transformed ancestors break
position: fixedplacement.Pen.Editor.CaretOverlaynow anchors the caret withposition: absoluteon aposition: relativeoverlay root. Caret geometry still comes fromGeometryReader, butleft/topsubtract the overlay’s bounding box (read in the samemeasureWithRootpass as the caret rect) so the caret tracks the text instead of the viewport.Tests assert overlay-relative coordinates; the React spec and changeset describe the behavior;
readCaretRectis allowlisted for the overlay-origin DOM read.Reviewed by Cursor Bugbot for commit 6197b8c. Bugbot is set up for automated code reviews on this repo. Configure here.