-
Notifications
You must be signed in to change notification settings - Fork 45
Typeahead component with tdd approch #185
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
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
c2296ec
added typeahead component with tdd approch
f473961
added aria-expanded
d54e926
fixed linting error
64c9f2a
fixed linting error
f4ac3ff
updated snapshots
f3b6f87
added feature to use customer filter method
471aadc
updated test cases
b507806
implemented review comments
7d10452
updated code from develop
85bc143
updated snap shots
7091ffd
updated snapshots
246c3aa
updated snap shots
5e0be35
implemented review comments
e7ffb74
added jsx-a11y/label-has-associated-control
9956316
removed jsx-a11y/label-has-associated-control
ea54843
added one more test
29b6358
added one more test
3f58899
added minCharactersRequired
ad86784
Merge branch 'develop' into typeahead
RohitLuthra19 23b937f
commented the test cases failing on travis
5af0e75
fixed issue pressing down arrow key on last item should move to first…
57b5469
merged changes
9689dd7
implemented review comments
ef11282
updated review comments
727bf91
fixed function typeof check
e25a968
removed default function props with null
d308c01
updated snapshots
c061f6c
updated snapshots
6f5aa66
updated snapshots
950dd11
updated component to have accessibility support
47ea801
added typeahead entry in main export index.js file
dc44f19
Merge branch 'develop' into typeahead
cb84018
updated typeahead component to support intial instructions for access…
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,43 @@ | ||
| // @flow | ||
| /** | ||
| * | ||
| * ListItem | ||
| * | ||
| */ | ||
| import classNames from 'classnames'; | ||
|
|
||
| import type { ListItemProps } from './types'; | ||
| import Button from '../../atoms/Button'; | ||
|
|
||
| const ListItem = ({ | ||
| children, | ||
| index, | ||
| activeResult, | ||
| handleClick, | ||
| item, | ||
| onMouseEnter, | ||
| onMouseDown, | ||
| }: ListItemProps) => { | ||
| const isSelectedItem = index === activeResult; | ||
|
|
||
| return ( | ||
| <li | ||
| className={classNames({ active: isSelectedItem })} | ||
| role="option" | ||
| id={isSelectedItem && 'selectedOption'} | ||
| aria-selected={isSelectedItem} | ||
| > | ||
| <Button | ||
| fullWidth | ||
| transparent | ||
| onClick={() => handleClick(item)} | ||
| onMouseEnter={onMouseEnter} | ||
|
RohitLuthra19 marked this conversation as resolved.
|
||
| onMouseDown={onMouseDown} | ||
| > | ||
| {children} | ||
| </Button> | ||
| </li> | ||
| ); | ||
| }; | ||
|
|
||
| export default ListItem; | ||
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.