Skip to content

Commit

Permalink
Update field_dropdown.js
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyMakesThings authored Feb 9, 2024
1 parent d11a554 commit 77eca6f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions core/field_dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,15 @@ Blockly.FieldDropdown.prototype.isOptionListDynamic = function() {
* (human-readable text or image, language-neutral name).
*/
Blockly.FieldDropdown.prototype.getOptions = function() {
var options = [];

if (goog.isFunction(this.menuGenerator_)) {
return this.menuGenerator_.call(this);
}
return /** @type {!Array.<!Array.<string>>} */ (this.menuGenerator_);
options = this.menuGenerator_.call(this);
} else options = (this.menuGenerator_);

/** @type {!Array.<!Array.<string>>} */
if (options.length > 0) return options;
return [''];
};

/**
Expand Down

0 comments on commit 77eca6f

Please sign in to comment.