Skip to content

Commit 9111502

Browse files
authored
Search page A11y fixes (#9387)
* TFM tab has display: 'none' when collapsed + removed unused viewModel property * removed aria-expanded
1 parent 8ff5267 commit 9111502

6 files changed

Lines changed: 8 additions & 17 deletions

File tree

src/Bootstrap/dist/css/bootstrap-theme.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bootstrap/less/theme/page-list-packages.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
}
122122

123123
.tfmTab {
124+
display: none;
124125
max-height: 0;
125126
overflow: hidden;
126127
transition: max-height 0.1s ease-out;

src/NuGetGallery/Controllers/PackagesController.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,8 +1366,6 @@ public virtual async Task<ActionResult> ListPackages(PackageListSearchViewModel
13661366

13671367
// If the experience hasn't been cached, it means it's not the default experienced, therefore, show the panel
13681368
viewModel.IsAdvancedSearchFlightEnabled = searchService.SupportsAdvancedSearch && isAdvancedSearchFlightEnabled;
1369-
viewModel.ShouldDisplayAdvancedSearchPanel = !shouldCacheAdvancedSearch || !includePrerelease;
1370-
13711369
viewModel.IsFrameworkFilteringEnabled = isFrameworkFilteringEnabled;
13721370

13731371
ViewBag.SearchTerm = q;

src/NuGetGallery/Scripts/gallery/page-list-packages.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,12 @@ $(function() {
5959
expandButton.classList.toggle('ms-Icon--ChevronUp');
6060

6161
if (this.classList.contains('active')) {
62+
dataTab.style.display = 'block';
6263
dataTab.style.maxHeight = dataTab.scrollHeight + "px";
63-
64-
for (const tfm of tfmCheckboxes) {
65-
tfm.setAttribute('tabindex', '0');
66-
tfm.tabindex = "0";
67-
}
6864
}
6965
else {
66+
dataTab.style.display = 'none';
7067
dataTab.style.maxHeight = 0;
71-
72-
for (const tfm of tfmCheckboxes) {
73-
tfm.setAttribute('tabindex', '-1');
74-
tfm.tabindex = "-1";
75-
}
7668
}
7769
}
7870

src/NuGetGallery/ViewModels/PackageListViewModel.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ public PackageListViewModel(
7878

7979
public string SortBy { get; set; }
8080

81-
public bool ShouldDisplayAdvancedSearchPanel { get; set; }
82-
8381
public bool IsAdvancedSearchFlightEnabled { get; set; }
8482

8583
public bool IsFrameworkFilteringEnabled { get; set; }

src/NuGetGallery/Views/Shared/ListPackages.cshtml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@
3737
</button>
3838
<div class="tfmTab" id="@(frameworkShortName)tab">
3939
<ul>
40-
@foreach (var tfm in tfms) {
40+
@foreach (var tfm in tfms)
41+
{
4142
<li>
42-
<input type="checkbox" id="@(tfm)" class="tfm" tabindex="-1" parent="@(frameworkShortName)">
43+
<input type="checkbox" id="@(tfm)" class="tfm" parent="@(frameworkShortName)">
4344
<label for="@(tfm)">@(tfm)</label>
4445
</li>
4546
}
@@ -195,7 +196,7 @@
195196
{
196197
<div class="row">
197198
<div class="col-xs-12 clearfix">
198-
<div class="panel panel-default" aria-expanded="true">
199+
<div class="panel panel-default">
199200
<div class="panel-body">
200201
NuGet package search works the same on nuget.org, from the NuGet CLI, and within the NuGet Package Manager extension in Visual Studio. <br />
201202
Check out our <strong><a href="https://docs.microsoft.com/nuget/consume-packages/finding-and-choosing-packages#search-syntax">Search Syntax</a></strong>.

0 commit comments

Comments
 (0)