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 53
fix(SelectableList): Items in list should be selectable #566
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
c191063
Reflect which item is selected in list
ed57ca8
Make list derived from autocontrolled component
29a06d2
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 9488202
small fix
dfce6d2
Merge branch 'fix/selectable-list-aria-selected' of https://github.co…
011a389
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 4a39717
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 29abd1a
Update ListExampleSelection.tsx
sophieH29 12d5caa
Update ListExampleSelection.shorthand.tsx
sophieH29 1242d6c
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 8238840
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 058d4d9
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 be1d9a8
Small improvement
d3070b6
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 4518290
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 f546086
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 0957b11
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 a45567e
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 75ab184
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 f1b2ae4
Rename *ItemIndex -> *Index
381d1e6
Merge latest master
46c33ac
Names refactoring
0daeb91
Minor improvements
bc74670
update changelog
727a066
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 e589ca9
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 a1f4fa0
Add onSelectedIndexChange
f794140
Add some tests
a45a820
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 c6e7435
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 72f3853
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 7937b90
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 450ad62
Small improvements afer CR
91ba179
Small improvements afer CR
9851381
Small improvements afer CR
5dc1695
Merge branch 'master' into fix/selectable-list-aria-selected
sophieH29 f1cc12c
create focus handler when List is constructed
kuzhelov-ms e0da352
fix changelog
kuzhelov-ms e093f16
changelog
kuzhelov-ms 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
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
14 changes: 6 additions & 8 deletions
14
...nents/List/Types/ListExampleSelection.tsx → ...ents/List/Types/ListExampleSelectable.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 |
---|---|---|
@@ -1,32 +1,30 @@ | ||
import React from 'react' | ||
import { List, Image } from '@stardust-ui/react' | ||
|
||
const selection = knobs => (knobs === undefined ? true : knobs.selection) | ||
|
||
const ListExampleSelection = ({ knobs }) => ( | ||
<List selection={selection(knobs)}> | ||
const ListExampleSelectable = () => ( | ||
<List selectable> | ||
<List.Item | ||
media={<Image src="public/images/avatar/small/matt.jpg" avatar />} | ||
header="Irving Kuhic" | ||
headerMedia="7:26:56 AM" | ||
content="Program the sensor to the SAS alarm through the haptic SQL card!" | ||
selection={selection(knobs)} | ||
selectable | ||
/> | ||
<List.Item | ||
media={<Image src="public/images/avatar/small/steve.jpg" avatar />} | ||
header="Skyler Parks" | ||
headerMedia="11:30:17 PM" | ||
content="Use the online FTP application to input the multi-byte application!" | ||
selection={selection(knobs)} | ||
selectable | ||
/> | ||
<List.Item | ||
media={<Image src="public/images/avatar/small/nom.jpg" avatar />} | ||
header="Dante Schneider" | ||
headerMedia="5:22:40 PM" | ||
content="The GB pixel is down, navigate the virtual interface!" | ||
selection={selection(knobs)} | ||
selectable | ||
/> | ||
</List> | ||
) | ||
|
||
export default ListExampleSelection | ||
export default ListExampleSelectable |
48 changes: 48 additions & 0 deletions
48
docs/src/examples/components/List/Types/ListExampleSelectableControlled.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,48 @@ | ||
import * as React from 'react' | ||
import { List, Image } from '@stardust-ui/react' | ||
|
||
class SelectableListControlledExample extends React.Component<any, any> { | ||
state = { selectedIndex: -1 } | ||
|
||
items = [ | ||
{ | ||
key: 'irving', | ||
media: <Image src="public/images/avatar/small/matt.jpg" avatar />, | ||
header: 'Irving Kuhic', | ||
headerMedia: '7:26:56 AM', | ||
content: 'Program the sensor to the SAS alarm through the haptic SQL card!', | ||
}, | ||
{ | ||
key: 'skyler', | ||
media: <Image src="public/images/avatar/small/steve.jpg" avatar />, | ||
header: 'Skyler Parks', | ||
headerMedia: '11:30:17 PM', | ||
content: 'Use the online FTP application to input the multi-byte application!', | ||
}, | ||
{ | ||
key: 'dante', | ||
media: <Image src="public/images/avatar/small/nom.jpg" avatar />, | ||
header: 'Dante Schneider', | ||
headerMedia: '5:22:40 PM', | ||
content: 'The GB pixel is down, navigate the virtual interface!', | ||
}, | ||
] | ||
|
||
render() { | ||
return ( | ||
<List | ||
selectable | ||
selectedIndex={this.state.selectedIndex} | ||
onSelectedIndexChange={(e, newProps) => { | ||
alert( | ||
`List is requested to change its selectedIndex state to "${newProps.selectedIndex}"`, | ||
) | ||
this.setState({ selectedIndex: newProps.selectedIndex }) | ||
}} | ||
items={this.items} | ||
/> | ||
) | ||
} | ||
} | ||
|
||
export default SelectableListControlledExample |
24 changes: 0 additions & 24 deletions
24
docs/src/examples/components/List/Types/ListExampleSelection.knobs.tsx
This file was deleted.
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
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.