Skip to content

Text selection boundary accumulates extra space after repeated pasting #1150

Description

@pubuzhixing8

Description

When content is pasted repeatedly into a text node, the gap between the right edge of the text selection boundary and the actual end of the text keeps increasing. This appears to be caused by an incorrect text width calculation.

Steps to reproduce

  1. Drag a text node onto the canvas.
  2. Double-click the text node to enter edit mode.
  3. Select all of the current text and copy it.
  4. Place the cursor at the end of the current text.
  5. Paste the copied content repeatedly.
  6. Observe the distance between the right edge of the text selection boundary and the actual end of the text.

Actual behavior

The empty space between the right edge of the text selection boundary and the actual end of the text increases with each paste.

Expected behavior

The distance between the right edge of the selection boundary and the end of the text should remain constant. It should match the distance between the left edge of the selection boundary and the beginning of the text, regardless of how many times content is pasted.

Environment

  • OS: macOS
  • Browser: Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: textText rendering, editing, measurement, and rich textbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions