fix: page rename position

This commit is contained in:
ascarbek 2023-03-09 22:54:38 +06:00
parent 593446bffe
commit f556e50be4

View File

@ -35,11 +35,11 @@ export const PageItem = ({ page, onPageClick }: { page: IPage; onPageClick: () =
const [popupY, setPopupY] = useState(0);
useEffect(() => {
if (showPageOptions && el.current) {
if (el.current) {
const { top } = el.current.getBoundingClientRect();
setPopupY(top);
}
}, [showPageOptions]);
}, [showPageOptions, showRenamePopup]);
return (
<div ref={el}>
@ -80,6 +80,7 @@ export const PageItem = ({ page, onPageClick }: { page: IPage; onPageClick: () =
value={page.title}
onChange={(newTitle) => changePageTitle(newTitle)}
onClose={closeRenamePopup}
top={popupY - 124 + 40}
></RenamePopup>
)}
</div>