diff --git a/framework/core/js/lib/components/dropdown-split.js b/framework/core/js/lib/components/dropdown-split.js index 77544c464..882d057ce 100644 --- a/framework/core/js/lib/components/dropdown-split.js +++ b/framework/core/js/lib/components/dropdown-split.js @@ -10,7 +10,11 @@ import ActionButton from 'flarum/components/action-button'; */ export default class DropdownSplit extends Component { view() { - var firstItem = this.props.items[0]; + var firstItem = this.props.items; + while (firstItem instanceof Array) { + firstItem = firstItem[0]; + } + var items = listItems(this.props.items); var buttonProps = {}; diff --git a/framework/core/js/lib/utils/item-list.js b/framework/core/js/lib/utils/item-list.js index f119adf0f..f5bc6e3f5 100644 --- a/framework/core/js/lib/utils/item-list.js +++ b/framework/core/js/lib/utils/item-list.js @@ -64,15 +64,6 @@ export default class ItemList { array = array.map(item => item.content); - //recursively flatten array - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] instanceof Array) { - array = array.concat.apply([], array); - i-- //check current index again and flatten until there are no more nested arrays at that index - len = array.length; - } - } - return array; } }