menu/dropdown: display label when value is undefined

This commit is contained in:
jean-emmanuel 2022-03-31 11:12:04 +02:00
parent fd9f703bcf
commit 5c6d065f9b
2 changed files with 3 additions and 2 deletions

View file

@ -53,7 +53,7 @@ class MenuBase extends Widget {
if (i > -1 && string) {
this.text.innerHTML = iconify(String(string).replace(/%value/g, typeof this.value === 'string' ? this.value : JSON.stringify(this.value)).replace(/%key/g, this.keys[i]))
} else {
this.text.innerHTML = ''
this.text.innerHTML = iconify(String(string).replace(/%value/g, '').replace(/%key/g, ''))
}
}