You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're implementing a mention popup (triggered by @ / # indicators) and we'd love to position it near the caret β similar to how desktop editors like VS Code, Slack, or Notion show autocomplete suggestions right at the cursor.
Currently, onChangeSelection provides character offsets (start, end, text), which is great for text manipulation, but doesn't give us the pixel coordinates needed to position a floating UI element near the caret.
Without screen coordinates, the best we can do is show the mention list relative to the editor container (e.g. pinned to the bottom), which works but isn't as polished as anchoring it to the cursor position.
Is this something that could be supported, or is there a workaround we might be missing? Would love to hear your thoughts.
Thanks for the suggestion!
At the moment, we don't plan to implement this feature because there hasn't been enough interest from the community. We'll keep this feature request open, though, so others can upvote or comment on it.
If we see more demand for this feature in the future, we'll definitely reconsider implementing it.
I think this feature is quite simple to implement if I'm not mistaken.
For iOS we can do in textViewDidChangeSelection the next thing:
if (emitter != nullptr) {
// iOS range works differently because it specifies location and length
// here, start is the location, but end is the first index BEHIND the end.
// So a 0 length range will have equal start and end
CGPoint cursorPosition = [textView caretRectForPosition:textView.selectedTextRange.start].origin; // <--- this gets the position
emitter->onChangeSelection(
{.start = static_cast<int>(textView.selectedRange.location),
.end = static_cast<int>(textView.selectedRange.location +
textView.selectedRange.length),
.x = cursorPosition.x,
.y = cursorPosition.y,
.text = [textAtSelection toCppString]});
}
And then we can store somewhere the layout position of text input (get it from onLayout) and add it to the selection position. This way we can do something like (red square is following the caret position):
(but I guess the user of this will also need to cater for the max height of the input, the offsets and other stuff as we see in the end of the gif it just flies further, but it's only because I quickly "sketched" some code for its' positioning)
If you guys are interested - I can also look at Android's implementation of this and create a PR.
Activity
[-]Feature request: Expose caret/cursor screen coordinates[/-][+][Feature request] Expose caret/cursor screen coordinates[/+]kacperzolkiewski commentedon Jul 14, 2026
Hi @ErionTp,
Thanks for the suggestion!
At the moment, we don't plan to implement this feature because there hasn't been enough interest from the community. We'll keep this feature request open, though, so others can upvote or comment on it.
If we see more demand for this feature in the future, we'll definitely reconsider implementing it.
IslamRustamov commentedon Jul 27, 2026
I think this feature is quite simple to implement if I'm not mistaken.
For iOS we can do in
textViewDidChangeSelectionthe next thing:And then we can store somewhere the layout position of text input (get it from
onLayout) and add it to the selection position. This way we can do something like (red square is following the caret position):(but I guess the user of this will also need to cater for the max height of the input, the offsets and other stuff as we see in the end of the gif it just flies further, but it's only because I quickly "sketched" some code for its' positioning)
If you guys are interested - I can also look at Android's implementation of this and create a PR.