Skip to main content

Home > blockly > FieldVariable > onItemSelected_

FieldVariable.onItemSelected_() method

Handle the selection of an item in the variable dropdown menu. Special case the 'Rename variable...' and 'Delete variable...' options. In the rename case, prompt the user for a new name.

Signature:

protected onItemSelected_(menu: Menu, menuItem: MenuItem): void;

Parameters

ParameterTypeDescription
menuMenuThe Menu component clicked.
menuItemMenuItemThe MenuItem selected within menu.

Returns:

void