diff --git a/app/components/p8p_gantt.js b/app/components/p8p_gantt.js index 9a4c48e..0cb42f8 100644 --- a/app/components/p8p_gantt.js +++ b/app/components/p8p_gantt.js @@ -7,7 +7,7 @@ //Подключение библиотек //--------------------- -import React, { useEffect, useState, useCallback } from "react"; //Классы React +import React, { useEffect, useState, useCallback, useRef } from "react"; //Классы React import PropTypes from "prop-types"; //Контроль свойств компонента import { Box, @@ -364,6 +364,9 @@ const P8PGantt = ({ editTask: null }); + //Ссылки на DOM + const svgContainerRef = useRef(null); + //Отображение диаграммы const showGantt = useCallback(() => { if (!state.gantt) { @@ -418,6 +421,11 @@ const P8PGantt = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [tasks]); + //При подключении компонента к старице + useEffect(() => { + svgContainerRef.current.children[0].classList.add("scroll"); + }, []); + //Генерация содержимого return (