fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Overflow set renders incorrectly when there are no overflow items

Open christiango opened this issue 9 years ago • 3 comments

Bug Report

  • Package version(s): office-ui-fabric-react v2.25.0

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? Yes

Requested priority: Normal

Describe the issue:

There are a few bugs in overflow set when there are no overflow items. The problematic line of code is here:

{ overflowItems.length && onRenderOverflowButton(overflowButtonProps) }

First off, overflowItems is optional, so this causes an exception when overflowitems.length is undefined.

Second, when an empty array is passed in as overflowItems, the result of this logical expression is 0, which means a zero is rendered instead of nothing.

Actual behavior:

The number zero is rendered

image

Expected behavior:

No overflow menu is rendered

christiango avatar May 10 '17 18:05 christiango

@micahgodbolt I'll work on a PR for this.

christiango avatar May 10 '17 18:05 christiango

Yeah I came across this as well when working it into my resize group example. Should just test to see if it is defined, not length.

micahgodbolt avatar May 10 '17 19:05 micahgodbolt

Thanks for stepping up to make a fix for this, @christiang88.

Jahnp avatar May 11 '17 03:05 Jahnp