瀏覽代碼

fix parent node width

AykutSarac 2 年之前
父節點
當前提交
f3b97d854f
共有 2 個文件被更改,包括 2 次插入1 次删除
  1. 1 0
      src/containers/Modals/ImportModal/index.tsx
  2. 1 1
      src/utils/core/calculateNodeSize.ts

+ 1 - 0
src/containers/Modals/ImportModal/index.tsx

@@ -86,6 +86,7 @@ export const ImportModal: React.FC<ModalProps> = ({ visible, setVisible }) => {
           onChange={e => setURL(e.target.value)}
           type="url"
           placeholder="URL of JSON to fetch"
+          autoFocus
         />
         <StyledUploadWrapper>
           <input

+ 1 - 1
src/utils/core/calculateNodeSize.ts

@@ -29,7 +29,7 @@ export const calculateNodeSize = (text: string | [string, string][], isParent =
   const getWidth = () => {
     if (text.length === 0) return 35;
     if (Array.isArray(text) && !text.length) return 40;
-    if (!isFolded) return 35 + longestLine * 7.8 + (isParent ? 60 : 0);
+    if (!isFolded) return 35 + longestLine * 7.8 + (isParent ? 80 : 0);
     if (isParent && isFolded) return 170;
     return 200;
   };