Skip to main content

blockly > IFlyoutInflater

IFlyoutInflater interface

Signature:

export interface IFlyoutInflater

Methods

Method

Description

disposeItem(item)

Disposes of the given element.

If the element in question resides on the flyout workspace, it should remove itself. Implementers are not otherwise required to fully dispose of the element; it may be e.g. cached for performance purposes.

gapForItem(state, defaultGap)

Returns the amount of spacing that should follow the element corresponding to the given JSON representation.

getType()

Returns the type of items that this inflater is responsible for inflating. This should be the same as the name under which this inflater registers itself, as well as the value returned by getType() on the FlyoutItem objects returned by load().

load(state, flyout)

Loads the object represented by the given state onto the workspace.

Note that this method's interface is identical to that in ISerializer, to allow for code reuse.

You must ensure that any item created by this method has the appropriate ARIA markup: - The role of the element's focusable element should be set to listitem. - The focusable element must have an id attribute. - Any DOM parents of the focusable element should set their role to presentation to avoid interfering with flyout list navigation. - If the element is not focusable, it must be hidden from the ARIA tree. Only do this if the content should be inaccessible to screenreaders.