Skip to content

An empty line is added when the user opens or reloads the the document . #385

@Isini-Dananjana

Description

@Isini-Dananjana

Discussed in #384

Originally posted by Isini-Dananjana February 23, 2023
When using YJS with Plate, it adds a new line to the top of a shared document whenever a new user joins the collaboration session. I think this happens due to the following code found in yTextToSlateElement.

 const children =
    // eslint-disable-next-line @typescript-eslint/no-use-before-define
    delta.length > 0 ? delta.map(deltaInsertToSlateNode) : [{ text: '' }];

  return { ...yText.getAttributes(), children };

When multiple users are in the same document, this empty line that is added also gets synced, resulting in many empty lines.

Any idea how to resolve the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions