Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

fix(List): remove listRef from API #489

Merged
merged 2 commits into from
Nov 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Fix Teams Icons styles to match spec @codepretty ([#441](https://github.com/stardust-ui/react/pull/441))
- Fix styles as functions in shorthands are not applied @mnajdova ([#470](https://github.com/stardust-ui/react/pull/470))
- Add `lodash` typings and fix compilation errors @Bugaa92 ([#438](https://github.com/stardust-ui/react/pull/438))
- Remove unsafe `listRef` from `List` API @kuzhelov ([#489](https://github.com/stardust-ui/react/pull/489))

### Features
- Make `Grid` keyboard navigable by implementing `gridBehavior` @sophieH29 ([#398](https://github.com/stardust-ui/react/pull/398))
Expand Down
9 changes: 0 additions & 9 deletions src/components/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ export interface ListProps extends UIComponentProps<any, any>, ChildrenComponent
/** Shorthand array of props for ListItem. */
items?: ShorthandValue[]

/** Ref callback with the list DOM node. */
listRef?: (node: HTMLElement) => void

/** A selection list formats list items as possible choices. */
selection?: boolean

Expand Down Expand Up @@ -70,7 +67,6 @@ class List extends UIComponent<Extendable<ListProps>, ListState> {
selection: PropTypes.bool,
truncateContent: PropTypes.bool,
truncateHeader: PropTypes.bool,
listRef: PropTypes.func,
renderItem: PropTypes.func,
}

Expand All @@ -91,10 +87,6 @@ class List extends UIComponent<Extendable<ListProps>, ListState> {
private focusHandler: ContainerFocusHandler = null
private itemRefs = []

private handleListRef = (listNode: HTMLElement) => {
_.invoke(this.props, 'listRef', listNode)
}

actionHandlers: AccessibilityActionHandlers = {
moveNext: e => {
e.preventDefault()
Expand Down Expand Up @@ -123,7 +115,6 @@ class List extends UIComponent<Extendable<ListProps>, ListState> {
{...accessibility.keyHandlers.root}
{...rest}
className={classes.root}
ref={this.handleListRef}
>
{childrenExist(children) ? children : this.renderItems()}
</ElementType>
Expand Down