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

feat(autocomplete): create component #410

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Leotheluck
Copy link
Contributor

@Leotheluck Leotheluck commented Mar 27, 2024

Description

OsdsAutocomplete is a new component that allows users to type into an input that will open a dropdown displaying a list of selectable options from which the user can choose from.

Keep in mind the OsdsAutocomplete component is not meant to implement the logic of sorting or filtering the elements that we put inside it. Example of one possible filtering logic is to be found in the index.html but is only for testing purpose.

Content

  • New component OsdsAutocomplete
  • Documentation
  • Storybook stories

To review

Check if the component works properly in multiple environments and situations. Also make sure that documentation is up to the requirements. Look for any potential mistakes or improvements we could address.

To be added

  • Loading state
  • BEM SCSS & remove !important (there was an issue with linters being investigated)
  • Add a "With logic" page to Storybook

@Leotheluck Leotheluck added the enhancement New feature or request label Mar 27, 2024
@Leotheluck Leotheluck self-assigned this Mar 27, 2024
@Leotheluck Leotheluck marked this pull request as ready for review April 2, 2024 07:41
@Leotheluck Leotheluck requested a review from a team as a code owner April 2, 2024 07:41
@Leotheluck Leotheluck marked this pull request as draft April 2, 2024 08:16
@Leotheluck Leotheluck marked this pull request as ready for review April 12, 2024 06:39
Copy link
Contributor

@dpellier dpellier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue when doing the following (tested on FF):

  • on Demo page, click on input
  • click on Bonjour
  • click on the clearable icon
  • click on input to reopen the list
  • click on Bonjour
    ==> Empty input

<IconProperty />

### Inline
<InlineProperty />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline is set twice

Copy link
Contributor

@astagnol astagnol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Global
There is no 'no results found' text to display for the Autocomplete component but it would be great to show how to integrate this in the example with logic

Keyboard navigation
We should not have to 'Tab' twice to be able to type in the field (careful with Safari, currently there is no focus at all on 'Tab', it exits the field)

When the dropdown is displayed, 'Tab' should enable focus on the next element but not the options:

  • if the user has moved forward through the list of options with 'arrow', the focused option = selected value & the dropdown is closed on 'Tab'. Since an option is selected, we should focus on clearable Icon.
  • if no option is focused yet, the dropdown is closed & the next focusable element is focused on 'Tab'

When the user selects an option on 'Enter', dropdown is closed & the field is in state 'focus'.

Mouse
The dropdown is closed & the field is in state 'focus' when the user clicks on an option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants