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(design): create select component #2458

Draft
wants to merge 17 commits into
base: develop
Choose a base branch
from
Draft

Conversation

xelaint
Copy link
Member

@xelaint xelaint commented Jun 2, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

There is no dropdown components.

Things that need to be added:

  • Loading state
  • Error state
  • When a user clicks somewhere outside a dropdown when it's open, the dropdown should close. (use cdk overlay)
  • By default, a dropdown should either render a label text of what the dropdown is or one of the options as the selected value (i.e. shipping addresses, render the first available address as the selected option or the "default" address a user has set in their account)
  • Keyboard behavior for selecting options
  • Accessibility considerations (aria label announcements for each option, selected option announcement)
  • Tests
  • Documentation
  • Implement as CVA
  • Don't render options when dropdown isn't open
  • Rename to DaffSelect
  • Block tab event if select is open

Fixes: #2467

What is the new behavior?

A dropdown component that displays a list of options.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@xelaint xelaint added the package: design @daffodil/design label Jun 2, 2023
@xelaint xelaint added this to the v0.8.0 - The Design Package V2 milestone Jun 2, 2023
@griest024 griest024 self-assigned this Jun 7, 2023
@damienwebdev damienwebdev mentioned this pull request Jun 9, 2023
8 tasks
@griest024 griest024 force-pushed the dropdown-component branch from 221d199 to c70cef7 Compare June 13, 2023 00:44
@griest024
Copy link
Member

By default, a dropdown should either render a label text of what the dropdown is or one of the options as the selected value (i.e. shipping addresses, render the first available address as the selected option or the "default" address a user has set in their account)

So does the dropdown track the selected state or is that the responsibility of the consuming component?

@xelaint
Copy link
Member Author

xelaint commented Jun 13, 2023

By default, a dropdown should either render a label text of what the dropdown is or one of the options as the selected value (i.e. shipping addresses, render the first available address as the selected option or the "default" address a user has set in their account)

So does the dropdown track the selected state or is that the responsibility of the consuming component?

@damienwebdev any input on this?

@griest024
Copy link
Member

@xelaint we discussed this on a call, the component implementation will change significantly. You will probably have some styling to do after

@griest024 griest024 force-pushed the dropdown-component branch 2 times, most recently from 0b72f99 to 2d49c3f Compare June 15, 2023 20:50
@griest024 griest024 changed the title feat(design): create dropdown component feat(design): create select component Jun 15, 2023
@griest024
Copy link
Member

@xelaint this is ready for you to do some styling and fix skeleton. I haven't touched keyboard navigation or accessbility yet

@xelaint xelaint force-pushed the dropdown-component branch 4 times, most recently from 4beb789 to c3e4b07 Compare June 15, 2023 22:25
@xelaint
Copy link
Member Author

xelaint commented Jun 16, 2023

How does this component actually handle errors aside from having the daff-error-message slot? Do we need to add an error property? Since I need to add error styles to the component on top of showing an error message.

@xelaint
Copy link
Member Author

xelaint commented Jul 27, 2023

TODO: An opened select should not be tabbable. Tab event needs to be blocked so focus is not lost on select. @griest024

@xelaint xelaint added the status: wip This PR is WIP. It should be marked as a draft. label Nov 28, 2023
@griest024
Copy link
Member

TODO: An opened select should not be tabbable. Tab event needs to be blocked so focus is not lost on select. @griest024

done

@xelaint
Copy link
Member Author

xelaint commented Dec 18, 2023

@griest024 There's a weird scrolling behavior if I open the select using Alt + Down key. https://www.loom.com/share/3123202d6ece417f8d2bc4a3e18af75a?sid=2c2c9540-2563-48c8-85ff-1e4d87203151

@xelaint xelaint force-pushed the dropdown-component branch 2 times, most recently from 21fddef to a924be7 Compare December 19, 2023 16:13
@damienwebdev
Copy link
Member

This needs a rebase against develop.

@xelaint
Copy link
Member Author

xelaint commented Sep 17, 2024

To do for me: fix conflict, rebase against develop, convert to standalone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: design @daffodil/design status: wip This PR is WIP. It should be marked as a draft.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Select Component
4 participants