Skip to content

Commit

Permalink
Merge pull request #14430 from jchyb/scaladoc/fix-i14421
Browse files Browse the repository at this point in the history
Scaladoc: Make member filtering case-insensitive
  • Loading branch information
pikinier20 authored Feb 15, 2022
2 parents 4a1586c + 025aa18 commit 990a367
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ class List {
: includesInputValue()

function includesInputValue() {
return elementData.name.includes(filter.value) || elementData.description.includes(filter.value);
const lcValue = filter.value.toLowerCase()
return elementData.name.toLowerCase().includes(lcValue)
|| elementData.description.toLowerCase().includes(lcValue);
}

function areFiltersFromElementSelected() {
Expand Down
8 changes: 5 additions & 3 deletions scaladoc/resources/dotty_res/scripts/components/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ class Filter {
* @returns { Filters }
*/
_generateFiltersOnTyping(value) {
const lcValue = value.toLowerCase()

const elementsDatasets = this.elementsRefs
.filter(element => {
const name = getElementTextContent(getElementNameRef(element));
const description = getElementTextContent(getElementDescription(element));
const lcName = getElementTextContent(getElementNameRef(element)).toLowerCase();
const lcDescription = getElementTextContent(getElementDescription(element)).toLowerCase();

return name.includes(value) || description.includes(value);
return lcName.includes(lcValue) || lcDescription.includes(lcValue);
})
.map(element => this._getDatasetWithKeywordData(element.dataset))

Expand Down

0 comments on commit 990a367

Please sign in to comment.