From c322be3a774d5ca53572c2e308f278a1c5dee040 Mon Sep 17 00:00:00 2001 From: kuzhelov Date: Mon, 19 Nov 2018 14:34:01 +0300 Subject: [PATCH 1/2] remove listRef from List API --- src/components/List/List.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/components/List/List.tsx b/src/components/List/List.tsx index 58b22c7502..55d7007a24 100644 --- a/src/components/List/List.tsx +++ b/src/components/List/List.tsx @@ -26,9 +26,6 @@ export interface ListProps extends UIComponentProps, 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 @@ -70,7 +67,6 @@ class List extends UIComponent, ListState> { selection: PropTypes.bool, truncateContent: PropTypes.bool, truncateHeader: PropTypes.bool, - listRef: PropTypes.func, renderItem: PropTypes.func, } @@ -91,10 +87,6 @@ class List extends UIComponent, ListState> { private focusHandler: ContainerFocusHandler = null private itemRefs = [] - private handleListRef = (listNode: HTMLElement) => { - _.invoke(this.props, 'listRef', listNode) - } - actionHandlers: AccessibilityActionHandlers = { moveNext: e => { e.preventDefault() @@ -123,7 +115,6 @@ class List extends UIComponent, ListState> { {...accessibility.keyHandlers.root} {...rest} className={classes.root} - ref={this.handleListRef} > {childrenExist(children) ? children : this.renderItems()} From fea9b65f3b0f2a301eaa1ef18137ec14f38b2082 Mon Sep 17 00:00:00 2001 From: kuzhelov Date: Mon, 19 Nov 2018 15:04:13 +0300 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55d770633b..a5afb66a71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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))