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

Navigation Link: Default to list of pages #18899

Closed
obenland opened this issue Dec 4, 2019 · 2 comments · Fixed by #19458
Closed

Navigation Link: Default to list of pages #18899

obenland opened this issue Dec 4, 2019 · 2 comments · Fixed by #19458
Assignees
Labels
[Block] Navigation Affects the Navigation Block [Status] In Progress Tracking issues with work in progress

Comments

@obenland
Copy link
Member

obenland commented Dec 4, 2019

By default the Navigation Link block shows an empty search box, which is not super helpful when looking to add a new link. Rather than forcing users to search for the page they just created before they're able to add a link to it, let's offer them a list of their most recent pages by default.

@obenland obenland added the [Block] Navigation Affects the Navigation Block label Dec 4, 2019
@getdave getdave self-assigned this Jan 7, 2020
@getdave
Copy link
Contributor

getdave commented Jan 7, 2020

I'm going to take a look at this one.

@getdave
Copy link
Contributor

getdave commented Jan 7, 2020

I'll be updating this comment as I explore possible approaches.

Basic Research

  • The Nav Link block uses <LinkControl /> to create the hyperlink creation interface. It is this component that needs to display the list of default Pages.
  • LinkControl does not provide a means to display default options (as search results or otherwise). This is good because for accessibility reasons we'd need any options to be valid search results associated with the input control via ARIA.
  • Under the hood LinkControl defers (ultimately) to <URLInput />.
  • The data fetching itself happens within LinkControl but it is triggered by URLInput.
  • Fetching of search suggestions happens only when a valid value (must be longer than 2 chars) is entered into the URLInput component.
  • There is no way to programmatically trigger data fetching from outside of URLInput.
  • Search suggests are only displayed by URLInput if it's showSuggestions state value is true and there are some search results.

Suggested Approach

Given the above, we need to add a new API to URLInput which affords the ability to trigger data fetching without having to enter text into the <input>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants