dropdown_list_widget: Reorder MultiSelectDropdownListWidget constructor.

ES6 class constructors must call the superclass constructor before
accessing this.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2022-04-27 15:17:39 -07:00
committed by Tim Abbott
parent 175dd999ac
commit 59c4680370

View File

@@ -260,6 +260,15 @@ export function MultiSelectDropdownListWidget({
// A widget mostly similar to `DropdownListWidget` but
// used in cases of multiple dropdown selection.
DropdownListWidget.call(this, {
widget_name,
data,
default_text,
null_value,
on_update,
value,
});
// Initializing values specific to `MultiSelectDropdownListWidget`.
this.limit = limit;
this.on_close = on_close;
@@ -271,15 +280,6 @@ export function MultiSelectDropdownListWidget({
// essentially by just modifying the values in `data_selected` variable.
this.data_selected = []; // Populate the dropdown values selected by user.
DropdownListWidget.call(this, {
widget_name,
data,
default_text,
null_value,
on_update,
value,
});
if (limit === undefined) {
this.limit = 2;
blueslip.warn(