Skip to content

ItemView.addAction method

ItemView › addAction

Adds an icon button to the view's header.

The mock does not attach the button or wire the callback: it returns a new detached element.

Signature:

addAction(_icon: string, _title: string, _callback: (event: MouseEvent) => unknown): HTMLElement

Parameters:

ParameterTypeDescription
_iconstringThe icon id to show on the button.
_titlestringThe button's tooltip.
_callback(event: MouseEvent) => unknownThe handler to call when the button is clicked; never called by the mock.

Returns: HTMLElement — A new detached element standing in for the button.