Closed zaheer-Khan3260 closed 1 month ago
@zaheer-Khan3260 The change should be relatively simple. When a user updates text, typically two things happen:
1. The textSlice is updated because we want the next text added to the canvas to carry the same initial styling as the updated text.
2. The object in canvasSlice is updated because we want the change to persist in local storage. The app has logic to store canvasObjects from canvasSlice in local storage.
In cases such as changing text color, both of these updates should happen. However, for text content changes, only the second one should occur. This is because the default content, “Double click to edit text,” should remain for every new text.
For text content changes, when the user clicks outside the text area, we trigger the event handler onUpdate to dispatch the change to the Redux store.
I have provided the fix in this branch for your reference: https://github.com/low-earth-orbit/konva-whiteboard/compare/text-content-bug-fix?expand=1
Thanks for contributing, and I hope this helps you better understand the repo.
Could you revise your code in this PR accordingly?
Yeah sure!
Fix #60