From c31d90cbfc7434dd58418534d9609324e978fbfe Mon Sep 17 00:00:00 2001 From: Maxim Date: Wed, 13 Jan 2021 09:46:12 +0200 Subject: [PATCH] support options with labels only Add support of options without `text`, but with `label` --- coffee/lib/select-parser.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/coffee/lib/select-parser.coffee b/coffee/lib/select-parser.coffee index 86258e3b77a..1b7308aab6f 100644 --- a/coffee/lib/select-parser.coffee +++ b/coffee/lib/select-parser.coffee @@ -24,15 +24,16 @@ class SelectParser add_option: (option, group_position, group_disabled) -> if option.nodeName.toUpperCase() is "OPTION" - if option.text != "" + option_text = if option.text != "" then option.text else option.label + if option_text != "" if group_position? @parsed[group_position].children += 1 @parsed.push array_index: @parsed.length options_index: @options_index value: option.value - text: option.text - html: option.innerHTML + text: option_text + html: if option.innerHTML != "" then option.innerHTML else option_text title: option.title if option.title selected: option.selected disabled: if group_disabled is true then group_disabled else option.disabled