diff --git a/src/dotnet/APIView/APIViewWeb/Client/src/reviews.ts b/src/dotnet/APIView/APIViewWeb/Client/src/reviews.ts index 3c3053df5b4..8392e40de1e 100644 --- a/src/dotnet/APIView/APIViewWeb/Client/src/reviews.ts +++ b/src/dotnet/APIView/APIViewWeb/Client/src/reviews.ts @@ -1,12 +1,17 @@ $(() => { const searchBox = $("#searchBox"); - - // make the search box the initial focused element so users can just start typing once page loads - searchBox.focus(); - const context = $(".review-name") as any; - searchBox.keyup(function () { + // if already populated from navigating back, filter again + if (searchBox.val()) { + filter(); + } + + searchBox.on("input", function () { + setTimeout(filter, 300); + }); + + function filter() { // highlight matching text using mark.js framework and hide rows that don't match const searchText = (searchBox.val() as string).toUpperCase(); context.closest("tr").show().unmark(); @@ -17,5 +22,5 @@ } }); } - }); + } }); diff --git a/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Index.cshtml b/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Index.cshtml index cc0e004ba61..ae774d91652 100644 --- a/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Index.cshtml +++ b/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Index.cshtml @@ -12,7 +12,7 @@
- +