-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Navigation Component: What to Search and How #25509
Comments
Since both search and custom components are unknown quantities at this point, it's hard to say what the best path forward is until we have some a bunch of consumers of the component. Therefore, I believe that our main priorities should be simplicity of use for consumers and the ability to grow in complexity as needed. With that in mind, some thoughts on each approach: Require
|
Cool, thanks for looking into this! I'll close this issue. |
This issue depends on #25252, and was spurred by a discussion happened in #25315 (#25315 (comment) and following comments).
The plan (WIP in #25315) is to make
Navigation
searchable: typing into a search field would filter the items, keeping only those items that contain the search query.Normally,
NavigationItem
is used with atitle
prop (rendered as item label), so it's just obvious to search on that.But
NavigationItem
can also render a custom component, which makes thetitle
not mandatory (and not rendered anyway).We could search into the custom component's text content, although it could be expensive performance-wise on large navigation lists: for example, we might need to store its
ref
, or recursively traverse its DOM.Possibilities to discuss:
Require
title
for custom component items, even if it's not rendered.Add a new
keywords
prop, to be used simlarly to Blocks keywords. We could search on those if notitle
is provided, or even in addition to it.Store the custom component
ref
and search intoNode.textContent()
.Traverse recursively through the custom component children.
alt
attributes).The text was updated successfully, but these errors were encountered: