Skip to content

[BUG]: Get Text from Selection #338

@Te12944265-AMAHA

Description

@Te12944265-AMAHA

Describe the bug
I've been searching through documentation but I haven't found a good way to get the text selected by the phone cursor. Although I can directly use the phone's built in "copy" button to copy the selected text on the editor (after pasting, I confirm the text matches the selected text exactly), I can't figure out a way to do this through API. If I use something like state.doc.textBetween(), then it seems like there is a mismatch between the indices and what I get usually misses the first or the last character in my selection.

Expected behavior
If we could have an API call such as getSelectionAsText(from: number, to: number), then it might be easier to get the plain text of the selected portion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions