Browse Source

fix shrink parent node width

AykutSarac 2 năm trước cách đây
mục cha
commit
851aa4a912
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/components/CustomNode/TextNode.tsx

+ 1 - 1
src/components/CustomNode/TextNode.tsx

@@ -102,7 +102,7 @@ const TextNode: React.FC<TextNodeProps> = ({
 };
 
 function propsAreEqual(prev: TextNodeProps, next: TextNodeProps) {
-  return prev.value === next.value;
+  return prev.value === next.value && prev.width === next.width;
 }
 
 export default React.memo(TextNode, propsAreEqual);