Set property instead of set attribute

This commit resolves an issue with Safari not properly selecting an `<option>`.

Closes #17866.
PR #19024.
This commit is contained in:
Jimmy Axenhus
2023-08-03 07:34:24 +02:00
committed by GitHub
parent e68cf87f05
commit c4ed40b82f
3 changed files with 9 additions and 9 deletions

View File

@@ -191,10 +191,10 @@
const init = () => {
$('logLevelSelect').getElements('option').each((x) => {
if (selectedLogLevels.indexOf(x.value.toString()) !== -1) {
x.setAttribute('selected', '');
x.selected = true;
}
else {
x.removeAttribute('selected');
x.selected = false;
}
});