Skip to content

Commit

Permalink
Move search filter tooltips to the icons for better accessibility
Browse files Browse the repository at this point in the history
Some screen readers were reading the search filter as "void 0" when
mouseovering it. We avoid this by moving the tooltip from the anchor
element to the icon itself.
  • Loading branch information
richieri-bps committed Jan 21, 2025
1 parent a33aa43 commit 84f9b1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/RT/Interface/Web.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6219,6 +6219,7 @@ sub GetSVGImage {

if ( $args{'Title'} ) {
$svg .= q{ data-bs-toggle="tooltip" title="} . $m->interp->apply_escapes( $args{Title}, 'h' ) . q{"};
$svg .= q{ aria-label="} . $m->interp->apply_escapes( $args{Title}, 'h' ) . q{"};
}
$svg .= '>';
my $config = RT->Config->Get('SVG') || {};
Expand Down
4 changes: 2 additions & 2 deletions share/html/Elements/CollectionAsTable/Header
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ foreach my $col ( @Format ) {
if ( $field && $filter_comp ) {
my $tooltip = loc( 'Filter on [_1]', loc($field) );
my $icon = exists $filter_data{filter}{$field} ? 'funnel-fill' : 'funnel';
$icon = GetSVGImage(Name => $icon);
$icon = GetSVGImage(Name => $icon, Title => $tooltip);
$m->out(
qq{&nbsp;<a href="javascript:void(0)" class="btn btn-primary button search-filter" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="$tooltip">$icon</a>}
qq{&nbsp;<a href="javascript:void(0)" class="btn btn-primary button search-filter">$icon</a>}
);
$m->out( $m->scomp( $filter_comp, Attribute => $field, FilterData => \%filter_data, %ARGS ) );
}
Expand Down

0 comments on commit 84f9b1b

Please sign in to comment.