Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include info field in the multiselect search #7089

Open
wants to merge 3 commits into
base: v5/develop
Choose a base branch
from

Conversation

aofn
Copy link

@aofn aofn commented Mar 26, 2025

Description

This PR enhances the multiselect field in the panel to optionally include the info field in the search.

image

Summary of changes

  • adapt logic of filteredOptions method to optionally include the info field in the search
  • highlight the text of the info field if the field is included in the search

Reasoning

When displaying longer text within the tags of the multiselect field, the tags can become excessively large and hard to read. In those cases, it makes sense to use the info field for additional information. However, the info field is not included in the search. This can be desirable, but also leads to tags being undisoverable if a user is searching for text included in the info field rather than the text field.

Additional context

We are currently utilising the multiselect component to categorise content with a complex tree structure for the new CMS for the annual Rundgang at UdK Berlin. Users are required to select the leaf node at the end of a tree to categorise a page. Our goal is to display the paths as follows:

  • "text": leaf
  • "info": branch 1 -> branch 2 -> branch 3

The problem arises when users are searching for any of the "branches" as they receive no results due to only the text field being searchable. The current workaround is to display the entire path within the text field, which leads to excessively long tags and is not a viable solution.

Changelog

Fixes

info field not being searchable

Breaking changes

none

Docs

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and CI checks all pass

For review team

  • Add lab and/or sandbox examples (wherever helpful)
  • Add changes & docs to release notes draft in Notion

aofn added 3 commits March 26, 2025 11:45
…field

- enhanced the search functionality to optionally include the info field.
- filter results to remove duplicates from the search.
@aofn aofn marked this pull request as ready for review March 26, 2025 13:23
@distantnative distantnative added this to the 5.1.0 milestone Mar 29, 2025
@distantnative
Copy link
Member

Thanks for the PR, I have marked it for a review and potential merge for v5.1 as we want to wrap up v5.0 and stopped including new features/enhancements that aren't absolutely necessary for v5 to function. Thanks for the patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants