blockly > Field > getAriaValue
Field.getAriaValue() method
Gets an ARIA-friendly label representation of this field's value.
Note that implementations should generally always override this value to ensure a non-null value is returned. The default implementation relies on 'getText' which may return an empty string. A null return value from this function will prompt ARIA label generation to skip the field's value entirely when there may be a better contextual placeholder to use isstead.
For example, to avoid hiding an empty text input field from screen reader, implementations should ensure that if the text is an empty string, this function would return an appropriate, localized value such as "empty text".
Implementations are responsible for, and encouraged to, return a localized version of the ARIA representation of the field's value.
Signature:
getAriaValue(): string | null;
Returns:
string | null
An ARIA representation of the field's text, or null if no text is currently defined or known for the field.