Fix the selected value if no config nodes available

Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
This commit is contained in:
Gauthier Dandele 2024-06-24 17:37:28 +02:00 committed by GitHub
parent 9c511b6674
commit a5b53ee373
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -426,8 +426,13 @@ RED.editor = (function() {
}
});
// Set the select value
select.val(nodeValue);
const optionCount = select.find("option").length
if (optionCount === 1) {
// We only have the 'add new...' option
select.val('_ADD_')
} else {
select.val(nodeValue);
}
}
/**