You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Hello Michał,
I believe that the issue doesn’t show up in jQuery UI 1.12.1
This is because in 1.12.1 the content of item.value is being passed to
$.trim() function that forgives when is called with non-string argument and
doesn’t throw an exception.
Below is the relevant fragment of code of 1.12.1:
// Announce
the value in the liveRegion
label =
ui.item.attr( "aria-label" ) || item.value;
if ( label
&& $.trim( label ).length ) {
this.liveRegion.children().hide();
In jQuery UI 1.13.0 on the contrary this non-string values are being passed
to String.prototype.trim() function which is only expects string argument
and throws an exception is it’s not a string.
Below is the relevant code from 1.13.3:
// Announce
the value in the liveRegion
label =
ui.item.attr( "aria-label" ) || item.value;
if ( label
&& String.prototype.trim.call( label ).length ) {
Best regards,
Michael Shipaev
*From:* Michał Gołębiowski-Owczarek ***@***.***>
*Sent:* Friday, August 23, 2024 6:41 PM
*To:* jquery/jquery-ui ***@***.***>
*Cc:* mikhail-shipaev ***@***.***>; Author <
***@***.***>
*Subject:* Re: [jquery/jquery-ui] Autocomplete widget should use bound
item.label property as a fallback for empty aria-label. (Issue #2282)
Thanks for the report. Does the issue you describe exist when jQuery UI
1.12.1 is used or only with jQuery UI 1.13.0 or newer?
—
Reply to this email directly, view it on GitHub
<#2282 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKUYISI2S26KSEJMLLIPAM3ZS5QZFAVCNFSM6AAAAABM22L2CSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXGQZTQMRYGQ>
.
You are receiving this because you authored the thread.Message ID: <
***@***.***>
jquery-ui/ui/widgets/autocomplete.js
Lines 256 to 258 in 54f96ee
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.
The text was updated successfully, but these errors were encountered: