Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

πŸ› Listbox: select next/previous option when opening a listbox with no value #82

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmcnamara-eng
Copy link
Collaborator

@dmcnamara-eng dmcnamara-eng commented Sep 8, 2021

✨ What Changed & Why

Problem: In the case when a listbox has no default @value, opening the listbox and navigating with ArrowUp/ArrowDown does not function.

Solution: Fix setNextOptionActive and setPreviousOptionActive methods to function even when there is no active option.

πŸ‘Ή Before

before

πŸ˜‡ After

after

🌈 Testing

  1. Check out this branch
  2. Change tests/dummy/app/components/listboxes/basic.hbs:3 to have no default @value
  3. Run ember serve
  4. Navigate to http://localhost:4200/listbox/listbox-basic
  5. Observe ArrowUp/ArrowDown opens the listbox and navigates up and down the list.

@dmcnamara-eng dmcnamara-eng force-pushed the bug/listbox-with-no-value-next-previous-option-active branch from be4d346 to 60ec9cf Compare September 8, 2021 14:43
@dmcnamara-eng dmcnamara-eng force-pushed the bug/listbox-with-no-value-next-previous-option-active branch from 60ec9cf to 860ae21 Compare September 8, 2021 14:49
@alexlafroscia
Copy link
Collaborator

This is a great fix! Could we add a test case to verify the new, correct behavior so that we don't end up with a regression down the line?

@dmcnamara-eng dmcnamara-eng marked this pull request as draft October 5, 2021 15:52
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants