pre-select an option if it is the only available one (#3337)

This commit is contained in:
Kevin Papst
2022-05-31 17:38:21 +02:00
committed by GitHub
parent 184026f5f1
commit 889e3c0d4a
6 changed files with 5 additions and 5 deletions

View File

@@ -205,7 +205,7 @@ export default class KimaiFormSelect extends KimaiPlugin {
select.val(selectedValue);
// pre-select an option if it is the only available one
if (select.val() === '') {
if (select.val() === '' || select.val() === null) {
const allOptions = select.find('option');
const optionLength = allOptions.length;
let selectOption = '';