Skip to content

Autocomplete widget should use bound item.label property as a fallback for empty aria-label. #2282

Open
@mikhail-shipaev

Description

@mikhail-shipaev

// Announce the value in the liveRegion
label = ui.item.attr( "aria-label" ) || item.value;
if ( label && String.prototype.trim.call( label ).length ) {

When li element in the dropdown list has an empty "aria-label" attribute current implementation fallbacks to using bound item.value for aria-label.

It'd be more logical using item.label for fallback instead.
Additionally this may lead to js exception when item.value is not of "string" type because in the next line it's passed to String.prototype.trim function that accepts only string arguments.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions