dropdown_widget: Style cannot view stream similar to disabled state.

This commit is contained in:
Aman Agrawal 2023-11-23 07:06:12 +00:00 committed by Tim Abbott
parent 2acf3cbfa4
commit ff19dda71c
3 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import $ from "jquery";
import * as tippy from "tippy.js";
import render_dropdown_current_value_not_in_options from "../templates/dropdown_current_value_not_in_options.hbs";
import render_dropdown_disabled_state from "../templates/dropdown_disabled_state.hbs";
import render_dropdown_list from "../templates/dropdown_list.hbs";
import render_dropdown_list_container from "../templates/dropdown_list_container.hbs";
@ -311,7 +312,11 @@ export class DropdownWidget {
// If provided, show custom text if cannot find current option.
if (!option && this.text_if_current_value_not_in_options) {
$(this.widget_value_selector).text(this.text_if_current_value_not_in_options);
$(this.widget_value_selector).html(
render_dropdown_current_value_not_in_options({
name: this.text_if_current_value_not_in_options,
}),
);
return;
}

View File

@ -1123,6 +1123,7 @@ div.overlay {
}
}
.dropdown-current-value-not-in-options,
.setting-disabled-option {
color: hsl(38deg 46% 54%);

View File

@ -0,0 +1 @@
<span class="dropdown-current-value-not-in-options">{{name}}</span>