Skip to content

Commit

Permalink
Merge pull request #1922 from akto-api-security/hotfix/fixed_title_of…
Browse files Browse the repository at this point in the history
…_dropdownsearch

fixed the title for dropdown search comp
  • Loading branch information
notshivansh authored Jan 6, 2025
2 parents 4c9150c + 5716562 commit f4300d5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function DropdownSearch(props) {
setTimeout(() => {
if (value === '' && selectedOptions.length === 0) {
const options = deselectedOptions.slice(0, defaultSliceValue);
const title = options.length > defaultSliceValue
const title = deselectedOptions.length != defaultSliceValue && options.length >= defaultSliceValue
? `Showing ${options.length} result${func.addPlurality(options.length)} only. (type more to refine results)`
: "Showing all results";
const nestedOptions = [{
Expand Down Expand Up @@ -100,7 +100,7 @@ function DropdownSearch(props) {
option[searchKey].match(filterRegex)
).slice(0, defaultSliceValue);

const title = resultOptions.length >= defaultSliceValue
const title = deselectedOptions.length != defaultSliceValue && resultOptions.length >= defaultSliceValue
? `Showing ${resultOptions.length} result${func.addPlurality(resultOptions.length)} only. (type more to refine results)`
: "Showing all results";

Expand Down

0 comments on commit f4300d5

Please sign in to comment.