소스 검색

fix: restore original container height when unbinding text which was binded via context menu (#6444)

* fix: restore original container height when unbinding text which was binded via context menu

* remove flag

* comment
Aakansha Doshi 2 년 전
부모
커밋
801412bf6b
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/actions/actionBoundText.tsx

+ 5 - 0
src/actions/actionBoundText.tsx

@@ -16,6 +16,7 @@ import {
 import {
   getOriginalContainerHeightFromCache,
   resetOriginalContainerCache,
+  updateOriginalContainerCache,
 } from "../element/textWysiwyg";
 import {
   hasBoundTextElement,
@@ -145,7 +146,11 @@ export const actionBindText = register({
         id: textElement.id,
       }),
     });
+    const originalContainerHeight = container.height;
     redrawTextBoundingBox(textElement, container);
+    // overwritting the cache with original container height so
+    // it can be restored when unbind
+    updateOriginalContainerCache(container.id, originalContainerHeight);
 
     return {
       elements: pushTextAboveContainer(elements, container, textElement),