menu: fix displaying new lines in labels/values

This commit is contained in:
bordun 2021-01-03 12:07:29 +01:00
parent cd7a29c51e
commit e8bc6a6d77
3 changed files with 7 additions and 2 deletions

View file

@ -49,8 +49,9 @@ class MenuBase extends Widget {
var string = this.getProp('label') === 'auto' ? '%value' : this.getProp('label'),
i = this.selected
if (i > -1 && string) {
this.text.innerHTML = iconify(String(string).replace(/%value/g, JSON.stringify(this.value)).replace(/%key/g, this.keys[i]))
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 = ''
}

View file

@ -280,7 +280,7 @@
.item {
white-space: pre;
z-index: 1;
overflow: hidden;
div {