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

[EuiSearchBar] Add the option to render a hint below the bar #6005

Closed
sebelga opened this issue Jun 27, 2022 · 6 comments · Fixed by #6319
Closed

[EuiSearchBar] Add the option to render a hint below the bar #6005

sebelga opened this issue Jun 27, 2022 · 6 comments · Fixed by #6319
Assignees

Comments

@sebelga
Copy link
Contributor

sebelga commented Jun 27, 2022

As part of the work the improve UX for the <TableListView /> in Kibana (the page rendering the list of dashboards, visualisations, maps) we want to be able to render a hint under the table search bar when the field is in focus.

We will need to add a new prop to the search bar (hint) that accepts a string or ReactNode to be passed.

Design

Screenshot 2022-06-27 at 16 41 48

@sebelga sebelga self-assigned this Jun 27, 2022
@chandlerprall
Copy link
Contributor

Sounds good to me. Thinking through what happens as the user types, I think any hint passed should always be rendered and it's up to the app to remove/modify in response to the user. That would allow more flexibility to provide hints against the content.

@1Copenut what accessibility rules should we ensure to follow here? e.g. linking the hint to the input with an aria-describedby or similar.

@1Copenut
Copy link
Contributor

Yeah, I think aria-describedby is a good use here. Is there a chance this will be used on mobile screens and/or the hint would be covered up by a typeahead? If either of those are true, would a visible label + hint above the input be appropriate?

@sebelga
Copy link
Contributor Author

sebelga commented Jun 28, 2022

Is there a chance this will be used on mobile screens and/or the hint would be covered up by a typeahead

Do you mean to render 2 different UIs depending if we detect that we are on mobile? If not we render the above design and if we are we render the hint below the label?

@1Copenut
Copy link
Contributor

Not specifically, I'm more asking a question. I'm all for consistency and brought it up because I'd seen that happen in past stops. Placement and UX aside, an aria-describedby is a great way to tie the hint text to an input semantically.

@cchaos
Copy link
Contributor

cchaos commented Jun 28, 2022

Consider the hint as just a popover footer. If the search has typeahead, thats' the main popover content with the hint being at the bottom in the same container. If there's not typeahead, it's just the footer/hint. So not two UI's.

@1Copenut
Copy link
Contributor

Following on what @cchaos said, I have one addenda for automated test suites. If the hint (aria-describedby) block is in the typeahead footer, you will need to add the attribute to the input dynamically when the typeahead is shown. Otherwise the input will have an attribute looking for an ID that's not in the DOM, and automated a11y tests will throw an error.

<main>
  <h1>ARIA describedby test</h1>
  <label for="input-test">Your name</label>
  <!-- Text element with id="input-hint" must be in the DOM **or** -->
  <!-- aria-describedby must be removed until the ID is present -->
  <input aria-describedby="input-hint" id="input-test" type="text" value="" />
</main>

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

Successfully merging a pull request may close this issue.

4 participants