Skip to content

Improve category dropdown search

For sections, user may search by name or abbreviation, ie Web and Authoring or IT-PW-WA.

Pass a new prop called searchPredicate to the dropdown component as shown in #searchPredicate with that implementation.

Should keep the current implementation and add support for match on info as well.

So something like:

function searchPredicate(node, searchTerm) {
  // keep previous implementantion
  if (node.label.toLowerCase().indexOf(term) >= 0)
    return True

  // fallback to search in category info
  return node.info && node.info.toLower().indexOf(searchTerm) >= 0
}