Executing the callback causes some unintentional changes to the page state.
See https://www.woltlab.com/community/thread/295991-dialoge-hintergrund-scrollt/
}
function closeSearch(): void {
+ const wasOpen = _pageHeader.classList.contains("searchBarOpen") || _pageHeaderSearch.classList.contains("open");
+ if (!wasOpen) {
+ return;
+ }
+
_pageHeader.classList.remove("searchBarOpen");
_pageHeaderSearch.classList.remove("open");
_userPanelSearchButton?.parentElement!.classList.remove("open");
}, 1);
}
function closeSearch() {
+ const wasOpen = _pageHeader.classList.contains("searchBarOpen") || _pageHeaderSearch.classList.contains("open");
+ if (!wasOpen) {
+ return;
+ }
_pageHeader.classList.remove("searchBarOpen");
_pageHeaderSearch.classList.remove("open");
_userPanelSearchButton === null || _userPanelSearchButton === void 0 ? void 0 : _userPanelSearchButton.parentElement.classList.remove("open");