Skip to content

[fix/editor]: generate unique id for text addition #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kaushik552k
Copy link

Summary

This PR addresses a bug in the text editor where adding text a second time would not display the new text, even though an empty text entry appeared in the timeline.

Issue Description

  • Problem: The text payload contained a static id, causing new text additions to replace the existing text.
  • Behavior: On first addition, text is correctly added. On subsequent additions, the timeline shows an empty text (due to the static id) rather than adding a new text element.

Changes Made

  • Removed the id from the TEXT_ADD_PAYLOAD.
  • Updated the handleAddText function to include id: generateId() so that every call produces a unique id.

How to Test

  1. Open the text editor.
  2. Add text multiple times.
  3. Verify that each text element is added with a unique id and is displayed correctly.

Previously, the text payload used a static id causing new text additions to overwrite the previous text. By removing the static id and generating a new id with generateId(), each text addition now creates a unique entry.
@kaushik552k kaushik552k reopened this Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant