fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

CommandBar: Click on MenuItem without children leads to null error

Open florianwachs opened this issue 9 years ago • 5 comments

Bug Report

  • Package version(s): 1.3.5

Describe the issue:

Using CommandBar with top-level IContextualMenuItem-Items leads to an error in https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/components/CommandBar/CommandBar.tsx#L320, if they have an onClick-Handler.

In the Line 320: if (this.state.contextualMenuProps.onDismiss), contextualMenuProps is null.

Actual behavior:

contextualMenuProps is null

Expected behavior:

The if-Statement should check if contextualMenuProps is null

florianwachs avatar Jan 31 '17 15:01 florianwachs

Got the same problem. Is there a workaround for now?

Ryu36 avatar Jan 31 '17 16:01 Ryu36

Patch incoming.

dzearing avatar Jan 31 '17 16:01 dzearing

I've expedited a patch release to address. @MLoughry please review the fix as I believe your change introduced this.

dzearing avatar Jan 31 '17 16:01 dzearing

https://github.com/OfficeDev/office-ui-fabric-react/releases/tag/office-ui-fabric-react_v1.3.6

dzearing avatar Jan 31 '17 17:01 dzearing

Awesome, thank you

florianwachs avatar Jan 31 '17 18:01 florianwachs