Replace forEach() with for()

This commit is contained in:
redphx
2024-10-22 10:42:09 +07:00
parent 01502363ab
commit 6cfff0274d
7 changed files with 25 additions and 16 deletions

View File

@@ -177,8 +177,9 @@ export class NavigationDialogManager {
}
calculateSelectBoxes($root: HTMLElement) {
const $selects = $root.querySelectorAll('.bx-select:not([data-calculated]) select');
$selects.forEach($select => {
const selects = Array.from($root.querySelectorAll('.bx-select:not([data-calculated]) select'));
for (const $select of selects) {
const $parent = $select.parentElement! as HTMLElement;
// Don't apply to select.bx-full-width elements
@@ -205,7 +206,7 @@ export class NavigationDialogManager {
// Set min-width
$label.style.minWidth = width + 'px';
$parent.dataset.calculated = 'true';
});
};
}
handleEvent(event: Event) {