diff --git a/src/qqq/components/forms/EntityForm.tsx b/src/qqq/components/forms/EntityForm.tsx index 2199ff9..bd01e2a 100644 --- a/src/qqq/components/forms/EntityForm.tsx +++ b/src/qqq/components/forms/EntityForm.tsx @@ -927,7 +927,7 @@ function EntityForm(props: Props): JSX.Element else { setAlertContent(error.message); - HtmlUtils.autoScroll(0); + scrollToTopToShowAlert(); } }); } @@ -973,7 +973,7 @@ function EntityForm(props: Props): JSX.Element else { setAlertContent(error.message); - HtmlUtils.autoScroll(0); + scrollToTopToShowAlert(); } }); } @@ -981,6 +981,22 @@ function EntityForm(props: Props): JSX.Element }; + /******************************************************************************* + ** + *******************************************************************************/ + function scrollToTopToShowAlert() + { + if (props.isModal) + { + document.getElementById("modalTopReference")?.scrollIntoView(); + } + else + { + HtmlUtils.autoScroll(0); + } + } + + /******************************************************************************* ** *******************************************************************************/ @@ -1265,6 +1281,7 @@ function EntityForm(props: Props): JSX.Element return ( + {body}