-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #807: fix accessibility search and total results
- Loading branch information
1 parent
a2221d9
commit 9f1e488
Showing
4 changed files
with
101 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 13 additions & 5 deletions
18
js-packages/search-frontend/src/components/TotalResults.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
import React from "react"; | ||
|
||
export function TotalResults({ | ||
totalResult | ||
totalResult, | ||
saveTotalResultState, | ||
}: { | ||
totalResult: number | null; | ||
saveTotalResultState?: React.Dispatch<React.SetStateAction<number | null>>; | ||
}) { | ||
return ( | ||
<div className="openk9-totalResults-container">{totalResult}</div> | ||
) | ||
} | ||
if (saveTotalResultState && totalResult) { | ||
saveTotalResultState(totalResult); | ||
} else { | ||
if (saveTotalResultState && totalResult!==null) { | ||
saveTotalResultState(0); | ||
} | ||
} | ||
|
||
return <div className="openk9-totalResults-container">{totalResult}</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters