From e114f3f2f3b50b63f0d514414bf6da16fd210e56 Mon Sep 17 00:00:00 2001 From: Sanae Date: Thu, 23 May 2024 23:23:12 +0000 Subject: [PATCH] use foreach instead of for to avoid weird problems --- ui/fields/select.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/fields/select.js b/ui/fields/select.js index 1cc1e111..2e6f1358 100644 --- a/ui/fields/select.js +++ b/ui/fields/select.js @@ -368,7 +368,7 @@ class OBFieldSelect extends OBField { #loadInnerOptions() { var options = {}; - for (const child of this.children) { + Array.from(this.children).forEach((child) => { if (child.tagName === 'OB-OPTION') { let key = child.getAttribute('value'); if (key) { @@ -381,7 +381,7 @@ class OBFieldSelect extends OBField { options[Object.keys(options).length] = child.innerHTML; } } - } + }); return options; } @@ -395,7 +395,7 @@ class OBFieldSelect extends OBField { } let index = 0; - for (const child of this.children) { + Array.from(this.children).forEach((child) => { if (child.tagName === 'OB-OPTION' && child.hasAttribute('selected')) { let value = child.getAttribute('value'); if (! value) { @@ -410,7 +410,7 @@ class OBFieldSelect extends OBField { } index = index + 1; - } + }); return selected; }