diff --git a/frontend/src/shared/components/CardComposer/index.tsx b/frontend/src/shared/components/CardComposer/index.tsx index ace4c25..a350ec5 100644 --- a/frontend/src/shared/components/CardComposer/index.tsx +++ b/frontend/src/shared/components/CardComposer/index.tsx @@ -1,4 +1,4 @@ -import React, { useState, useRef } from 'react'; +import React, { useState, useRef, useEffect } from 'react'; import PropTypes from 'prop-types'; import useOnEscapeKeyDown from 'shared/hooks/onEscapeKeyDown'; import useOnOutsideClick from 'shared/hooks/onOutsideClick'; @@ -25,6 +25,11 @@ const CardComposer = ({ isOpen, onCreateCard, onClose }: Props) => { const $cardRef = useRef(null); useOnOutsideClick($cardRef, true, onClose, null); useOnEscapeKeyDown(isOpen, onClose); + useEffect(() => { + if ($cardRef.current) { + $cardRef.current.scrollIntoView(); + } + }); return (