Type hint instead of a type cast
authorAlexander Ebert <ebert@woltlab.com>
Fri, 25 Jun 2021 15:04:45 +0000 (17:04 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 25 Jun 2021 15:04:45 +0000 (17:04 +0200)
The type hint is only meant to narrow the type, not replace it.

ts/WoltLabSuite/Core/Ui/Message/Quote.ts

index 551fd9b3f17e501394ff0cda32d9916de0d5fdf4..cf9f4a663cd6920ea4bb0284e9c7b96ea9a1518e 100644 (file)
@@ -483,7 +483,7 @@ export class UiMessageQuote implements AjaxCallbackObject {
     }
 
     // close navigation on mobile
-    const navigationList = listItem.closest(".buttonGroupNavigation") as HTMLUListElement | null;
+    const navigationList: HTMLUListElement | null = listItem.closest(".buttonGroupNavigation");
     if (navigationList && navigationList.classList.contains("jsMobileButtonGroupNavigation")) {
       const dropDownLabel = navigationList.querySelector(".dropdownLabel") as HTMLElement;
       dropDownLabel.click();