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

Parameter Type Description
menu Menu The Menu component clicked.
menuItem MenuItem The MenuItem selected within menu.

Returns:

void