Skip to main content

blockly > inputs > Input > setAriaLabelProvider

inputs.Input.setAriaLabelProvider() method

Sets a custom ARIA label provider for this input, or null if it should be reset to use the default method.

Inputs do not compute ARIA contexts directly, so the set provider will be used in select cases when the Input needs to be represented (such as for parts of a block label or for connections). Note that overriding this provider will not recompute any already constructed ARIA labels, and it cannot be assumed that the provider will be called any particular number of times during label recomputation. As such, implementations should make sure to provide a deterministic and idempotent ARIA representation each time the provider is called for a given input. It's also fine to reuse providers across multiple Input implementations.

Signature:

setAriaLabelProvider(provider: AriaLabelProvider | null): Input;

Parameters

Parameter

Type

Description

provider

AriaLabelProvider | null

The string or function to use to set the ARIA label for the input

Returns:

Input

The input being modified (to allow chaining).