diff --git a/Oqtane.Maui/wwwroot/js/interop.js b/Oqtane.Maui/wwwroot/js/interop.js index ef6043f9..675cebca 100644 --- a/Oqtane.Maui/wwwroot/js/interop.js +++ b/Oqtane.Maui/wwwroot/js/interop.js @@ -417,11 +417,20 @@ Oqtane.Interop = { } }, scrollTo: function (top, left, behavior) { - window.scrollTo({ - top: top, - left: left, - behavior: behavior - }); + const modal = document.querySelector('.modal'); + if (modal) { + modal.scrollTo({ + top: top, + left: left, + behavior: behavior + }); + } else { + window.scrollTo({ + top: top, + left: left, + behavior: behavior + }); + } }, scrollToId: function (id) { var element = document.getElementById(id);