blockly > Flyout > normalizeSeparators

Flyout.normalizeSeparators() method

Updates and returns the provided list of flyout contents to flatten separators as needed.

When multiple separators occur one after another, the value of the last one takes precedence and the earlier separators in the group are removed.

Signature:

protected normalizeSeparators(contents: FlyoutItem[]): FlyoutItem[];

Parameters

Parameter Type Description
contents FlyoutItem[] The list of flyout contents to flatten separators in.

Returns:

FlyoutItem[]

An updated list of flyout contents with only one separator between each non-separator item.