Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search page A11y fixes #9387

Merged
merged 2 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Bootstrap/dist/css/bootstrap-theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Bootstrap/less/theme/page-list-packages.less
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
}

.tfmTab {
display: none;
max-height: 0;
overflow: hidden;
transition: max-height 0.1s ease-out;
Expand Down
2 changes: 0 additions & 2 deletions src/NuGetGallery/Controllers/PackagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1363,8 +1363,6 @@ public virtual async Task<ActionResult> ListPackages(PackageListSearchViewModel

// If the experience hasn't been cached, it means it's not the default experienced, therefore, show the panel
viewModel.IsAdvancedSearchFlightEnabled = searchService.SupportsAdvancedSearch && isAdvancedSearchFlightEnabled;
viewModel.ShouldDisplayAdvancedSearchPanel = !shouldCacheAdvancedSearch || !includePrerelease;

viewModel.IsFrameworkFilteringEnabled = isFrameworkFilteringEnabled;

ViewBag.SearchTerm = q;
Expand Down
12 changes: 2 additions & 10 deletions src/NuGetGallery/Scripts/gallery/page-list-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,12 @@ $(function() {
expandButton.classList.toggle('ms-Icon--ChevronUp');

if (this.classList.contains('active')) {
dataTab.style.display = 'block';
dataTab.style.maxHeight = dataTab.scrollHeight + "px";

for (const tfm of tfmCheckboxes) {
tfm.setAttribute('tabindex', '0');
tfm.tabindex = "0";
}
}
else {
dataTab.style.display = 'none';
dataTab.style.maxHeight = 0;

for (const tfm of tfmCheckboxes) {
tfm.setAttribute('tabindex', '-1');
tfm.tabindex = "-1";
}
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/NuGetGallery/ViewModels/PackageListViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ public PackageListViewModel(

public string SortBy { get; set; }

public bool ShouldDisplayAdvancedSearchPanel { get; set; }

public bool IsAdvancedSearchFlightEnabled { get; set; }

public bool IsFrameworkFilteringEnabled { get; set; }
Expand Down
7 changes: 4 additions & 3 deletions src/NuGetGallery/Views/Shared/ListPackages.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
</button>
<div class="tfmTab" id="@(frameworkShortName)tab">
<ul>
@foreach (var tfm in tfms) {
@foreach (var tfm in tfms)
{
<li>
<input type="checkbox" id="@(tfm)" class="tfm" tabindex="-1" parent="@(frameworkShortName)">
<input type="checkbox" id="@(tfm)" class="tfm" parent="@(frameworkShortName)">
<label for="@(tfm)">@(tfm)</label>
</li>
}
Expand Down Expand Up @@ -195,7 +196,7 @@
{
<div class="row">
<div class="col-xs-12 clearfix">
<div class="panel panel-default" aria-expanded="true">
<div class="panel panel-default">
<div class="panel-body">
NuGet package search works the same on nuget.org, from the NuGet CLI, and within the NuGet Package Manager extension in Visual Studio. <br />
Check out our <strong><a href="https://docs.microsoft.com/nuget/consume-packages/finding-and-choosing-packages#search-syntax">Search Syntax</a></strong>.
Expand Down