Skip to content

Commit

Permalink
CommandBar does not render tooltipHostProps.content with iconOnly mod…
Browse files Browse the repository at this point in the history
…e as true (#14323)

#### Pull request checklist

- [x] Addresses an existing issue: Fixes #14310
- [ ] Include a change request file using `$ yarn change`

#### Description of changes

CommandBar does not render tooltipHostProps.content with iconOnly=true, when text/name is not available in ICommandBarItemProps

#### Focus areas to test

(optional)
  • Loading branch information
pranitha-surya authored Aug 11, 2020
1 parent 530cd42 commit f2c2968
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions change/office-ui-fabric-react-2020-08-03-14-39-05-master.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "patch",
"comment": "CommandBar: Show tooltipHost.content when iconMode = true even when text/name is provided in commandBarItemProps",
"packageName": "office-ui-fabric-react",
"email": "[email protected]",
"dependentChangeType": "patch",
"date": "2020-08-03T21:39:05.655Z"
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class CommandBarBase extends React.Component<ICommandBarProps, {}> implem
onClick: this._onButtonClick(item),
};

if (item.iconOnly && itemText !== undefined) {
if (item.iconOnly && (itemText !== undefined || item.tooltipHostProps)) {
return (
<TooltipHost content={itemText} {...item.tooltipHostProps}>
{this._commandButton(item, commandButtonProps)}
Expand Down

0 comments on commit f2c2968

Please sign in to comment.