Skip to content

What are the most significant benefits of the EditContext API compared to hidden textarea ? #102

Open
@devlzl

Description

@devlzl

I am a developer of a rich text editor engine.
I would like to know more about the advantages of EditContext API compared to contenteditable or hidden textarea.

I know that using contenteditable directly on the DOM to implement a rich text editor can lead to inconsistent data and unpredictable behavior.
So I now use a hidden textarea. I get user input by listening to beforeinput, compositionstart/compositionend and update my own text model and selection model, then render them. At the same time, by modifying the position of the textarea element, I make the IME window appear in the appropriate position.
Even when I use canvas to implement 3D art text input, I can also receive input text through a hidden textarea and then render it on the canvas.

So as of now, I'm not sure what significant benefits the EditContext API can bring me compared to hidden textarea?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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