diff --git a/src/modules/Dropdown/Dropdown.js b/src/modules/Dropdown/Dropdown.js index 5214aeb7dc..4be135eaa9 100644 --- a/src/modules/Dropdown/Dropdown.js +++ b/src/modules/Dropdown/Dropdown.js @@ -1124,7 +1124,7 @@ export default class Dropdown extends Component { const defaultProps = { active: item.value === selectedLabel, as: 'a', - key: item.value, + key: item.key || item.value, onClick: this.handleLabelClick, onRemove: this.handleLabelRemove, value: item.value, diff --git a/test/specs/modules/Dropdown/Dropdown-test.js b/test/specs/modules/Dropdown/Dropdown-test.js index 7090554ed4..28f94c47ba 100644 --- a/test/specs/modules/Dropdown/Dropdown-test.js +++ b/test/specs/modules/Dropdown/Dropdown-test.js @@ -1835,28 +1835,6 @@ describe('Dropdown', () => { }) }) - describe('renderOptions', () => { - it('prefers the option\'s "key" property for keying generated DropdownItems', () => { - const customOptions = [ - { text: '1', value: '1', key: 'a' }, - { text: '2', value: '2', key: 'b' }, - ] - wrapperShallow() - wrapper.should.contain('DropdownItem[key="a"]') - wrapper.should.contain('DropdownItem[key="b"]') - }) - - it('generates a "key" property using the option.value if no key is provided', () => { - const customOptions = [ - { text: '1', value: '1' }, - { text: '2', value: '2' }, - ] - wrapperShallow() - wrapper.should.contain('DropdownItem[key="1-0"]') - wrapper.should.contain('DropdownItem[key="2-1"]') - }) - }) - describe('Dropdown.Menu child', () => { it('renders child passed', () => { wrapperShallow(