소스 검색

change onBlurHandler

kosei-n 2 년 전
부모
커밋
691dd5711e
2개의 변경된 파일4개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 4
      apps/app/src/components/PageHeader/PageTitleHeader.tsx
  2. 2 2
      apps/app/src/components/PageHeader/TextInputForPageTitleAndPath.tsx

+ 2 - 4
apps/app/src/components/PageHeader/PageTitleHeader.tsx

@@ -1,5 +1,5 @@
 import type { FC } from 'react';
-import { useState, useMemo } from 'react';
+import { useState, useMemo, useEffect } from 'react';
 
 import nodePath from 'path';
 
@@ -41,9 +41,7 @@ export const PageTitleHeader: FC<Props> = (props) => {
   };
 
   const onBlurHandler = () => {
-    if (pageName === inputText) {
-      setRenameInputShown(false);
-    }
+    pagePathRenameHandler(inputText);
   };
 
   const buttonStyle = isRenameInputShown ? '' : 'd-none';

+ 2 - 2
apps/app/src/components/PageHeader/TextInputForPageTitleAndPath.tsx

@@ -1,5 +1,5 @@
-import { FC, useCallback } from 'react';
-import type { Dispatch, SetStateAction } from 'react';
+import { useCallback } from 'react';
+import type { Dispatch, SetStateAction, FC } from 'react';
 
 import nodePath from 'path';