File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21884,18 +21884,22 @@ return /******/ (function(modules) { // webpackBootstrap
2188421884 value: function renderOptions(options) {
2188521885 var _this7 = this;
2188621886
21887- return options.map(function (option) {
21887+ return options.map(function (option, index) {
21888+ // Intentionally use array index to allow React to jump to next selection
21889+ // https://github.com/jakezatecky/react-dual-listbox/issues/10
21890+ var key = 'key-' + index;
21891+
2188821892 if (option.options !== undefined) {
2188921893 return _react2.default.createElement(
2189021894 'optgroup',
21891- { key: option.label , label: option.label },
21895+ { key: key , label: option.label },
2189221896 _this7.renderOptions(option.options)
2189321897 );
2189421898 }
2189521899
2189621900 return _react2.default.createElement(
2189721901 'option',
21898- { key: option.value , value: option.value },
21902+ { key: key , value: option.value },
2189921903 option.label
2190021904 );
2190121905 });
Original file line number Diff line number Diff line change @@ -268,17 +268,21 @@ class DualListBox extends React.Component {
268268 * @returns {Array }
269269 */
270270 renderOptions ( options ) {
271- return options . map ( ( option ) => {
271+ return options . map ( ( option , index ) => {
272+ // Intentionally use array index to allow React to jump to next selection
273+ // https://github.com/jakezatecky/react-dual-listbox/issues/10
274+ const key = `key-${ index } ` ;
275+
272276 if ( option . options !== undefined ) {
273277 return (
274- < optgroup key = { option . label } label = { option . label } >
278+ < optgroup key = { key } label = { option . label } >
275279 { this . renderOptions ( option . options ) }
276280 </ optgroup >
277281 ) ;
278282 }
279283
280284 return (
281- < option key = { option . value } value = { option . value } >
285+ < option key = { key } value = { option . value } >
282286 { option . label }
283287 </ option >
284288 ) ;
You can’t perform that action at this time.
0 commit comments