From 6994a05e3b58c3ec77c5548111e10c04a04c30c1 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Mon, 23 Dec 2019 13:24:20 -0500 Subject: [PATCH] fix(dropdown): revert id change to have stable identifier --- .../react/src/components/Dropdown/Dropdown.js | 15 +++----------- .../__snapshots__/Dropdown-test.js.snap | 20 +++++++++---------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/packages/react/src/components/Dropdown/Dropdown.js b/packages/react/src/components/Dropdown/Dropdown.js index d3fa0ecd85b8..82fcde2dc14d 100644 --- a/packages/react/src/components/Dropdown/Dropdown.js +++ b/packages/react/src/components/Dropdown/Dropdown.js @@ -13,7 +13,6 @@ import { settings } from 'carbon-components'; import { WarningFilled16 } from '@carbon/icons-react'; import ListBox, { PropTypes as ListBoxPropTypes } from '../ListBox'; import { match, keys } from '../../internal/keyboard'; -import setupGetInstanceId from '../../tools/setupGetInstanceId'; const { prefix } = settings; @@ -25,8 +24,6 @@ const defaultItemToString = item => { return item ? item.label : ''; }; -const getInstanceId = setupGetInstanceId(); - export default class Dropdown extends React.Component { static propTypes = { /** @@ -152,10 +149,6 @@ export default class Dropdown extends React.Component { helperText: '', }; - constructor(props) { - super(props); - this.dropdownInstanceId = getInstanceId(); - } handleOnChange = selectedItem => { if (this.props.onChange) { this.props.onChange({ selectedItem }); @@ -197,10 +190,8 @@ export default class Dropdown extends React.Component { [`${prefix}--label--disabled`]: disabled, }); - const dropdownId = `dropdown-${this.dropdownInstanceId}`; - const title = titleText ? ( -