Skip to content

Slate editor scrolls on focus. #5538

Open
@shashtag

Description

@shashtag

We are creating a whiteboard application. The slate editor is toggled from the readOnly on double click. As the cursor does not automatically place at the end when the readOnly mode is set to false, we place the cursor to the end of the text area through code.

onFocus={(e) => {
    Transforms.select(editor, Editor.end(editor, []));
}}

Now we face an another problem due to this. The editor scrolls to the centre when this onFocus function is applied.

Screen.Recording.2023-10-27.at.1.02.48.PM.mov

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions