Web: Components: GroupButtonsMenu: Fixed countMenuItems function
This commit is contained in:
parent
c20e58cfba
commit
f8c731542d
@ -117,14 +117,13 @@ class GroupButtonsMenu extends React.PureComponent {
|
||||
|
||||
countMenuItems = (array, outerWidth, moreWidth) => {
|
||||
const itemsArray = array || []
|
||||
const moreButton = moreWidth || 0;
|
||||
let total = (moreButton + 80);
|
||||
let total = (moreWidth || 0) + 80;
|
||||
|
||||
for (let i = 0, len = itemsArray.length; i < len; i++) {
|
||||
if (total + array[i] > outerWidth) {
|
||||
if (total + itemsArray[i] > outerWidth) {
|
||||
return i < 1 ? 1 : i;
|
||||
} else {
|
||||
total += array[i];
|
||||
total += itemsArray[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user