Skip to content

Commit

Permalink
Fix the selected value if no config nodes available
Browse files Browse the repository at this point in the history
Co-authored-by: Nick O'Leary <[email protected]>
  • Loading branch information
GogoVega and knolleary authored Jun 24, 2024
1 parent 9c511b6 commit a5b53ee
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down

0 comments on commit a5b53ee

Please sign in to comment.