This repository was archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
feat(Dropdown): arrow navigation between selected items #842
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
23aa7d6
implemented navigation between selected items
bf1e7c5
removed label tabindex test
0327dee
removed unneeded imports from test file
4ab4b2d
added hover style for the selected item
2f63670
added RTL support for navigation
8a02cd1
updated changelog
3ed9639
added private modifier to a method
68cd625
renamed dropdopwn examples and splitted search examples
fe97d45
added InputSlotClassNames
4f73c41
added screener tests and bumped the screener-steps version
be38f23
added funtionality for the selection multiple as well
45def8d
fixed navigation issue from input to last selected item
665c806
removed presentation role from Label
ad45049
removed backspaceDelete from state as it is not needed anymore
f5cdf59
renamed activeIndex to activeSelectedIndex
1f55a4a
fixed a bug for multiple selection
887d940
fixed the condition
9e1cbdc
some code improvements
16b530d
Merge branch 'master' into feat/dropdown-arrow-navigation
silviuaavram 892e60a
Merge branch 'master' into feat/dropdown-arrow-navigation
silviuaavram File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
docs/src/examples/components/Dropdown/Types/DropdownExampleSearchMultiple.shorthand.steps.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { Dropdown, List, Indicator, Input, Label } from '../../../../../../packages/react/src' | ||
| import * as Keys from 'screener-runner/src/keys' | ||
|
|
||
| const steps = [ | ||
| steps => | ||
| steps | ||
| .click(`.${Dropdown.className} .${Indicator.className}`) | ||
| .click(`.${List.className} li:nth-child(2)`) | ||
| .click(`.${Dropdown.className} .${Indicator.className}`) | ||
| .click(`.${List.className} li:nth-child(2)`) | ||
| .keys(`.${Input.slotClassNames.input}`, Keys.leftArrow) | ||
| .snapshot('Selects last selected element'), | ||
| steps => | ||
| steps | ||
| .hover(`.${Dropdown.slotClassNames.selectedItems} .${Label.className}:nth-child(1)`) | ||
| .snapshot('Hovers first selected element'), | ||
| ] | ||
|
|
||
| export default steps |
26 changes: 26 additions & 0 deletions
26
docs/src/examples/components/Dropdown/Types/DropdownExampleSearchMultiple.shorthand.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import * as React from 'react' | ||
| import { Dropdown } from '@stardust-ui/react' | ||
|
|
||
| const inputItems = [ | ||
| 'Bruce Wayne', | ||
| 'Natasha Romanoff', | ||
| 'Steven Strange', | ||
| 'Alfred Pennyworth', | ||
| `Scarlett O'Hara`, | ||
| 'Imperator Furiosa', | ||
| 'Bruce Banner', | ||
| 'Peter Parker', | ||
| 'Selina Kyle', | ||
| ] | ||
|
|
||
| const DropdownExampleSearchMultiple = () => ( | ||
| <Dropdown | ||
| search | ||
| multiple | ||
| items={inputItems} | ||
| placeholder="Start typing a name" | ||
| noResultsMessage="We couldn't find any matches." | ||
| /> | ||
| ) | ||
|
|
||
| export default DropdownExampleSearchMultiple |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.