Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ export class Dropdown extends BaseComponent<IDropdownInternalProps, IDropdownSta
onMouseMove: this._onItemMouseMove.bind(this, item)
} }
label={ item.text }
onRenderLabel={ this._renderCustomLabel.bind(this, item) }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use @autobind. Also, _onRenderLabel might be a better name to match existing naming conventions in this file

className={ css(
'ms-ColumnManagementPanel-checkbox',
'ms-Dropdown-item', styles.item, {
Expand All @@ -531,8 +532,7 @@ export class Dropdown extends BaseComponent<IDropdownInternalProps, IDropdownSta
checkboxCheckedHovered: checkboxStyles.checkboxChecked,
textHovered: checkboxStyles.text
} }
>{ onRenderOption(item, this._onRenderOption) }
</Checkbox>
/>
)
);
}
Expand Down Expand Up @@ -843,5 +843,8 @@ export class Dropdown extends BaseComponent<IDropdownInternalProps, IDropdownSta
});
}
}

}
private _renderCustomLabel(item: IDropdownOption) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor -- I don't think Fabric has any style guidelines on this, but I'd move this method up with all the other render functions, around line 545

const { onRenderOption = this._onRenderOption } = this.props;
return onRenderOption(item, this._onRenderOption);
}
}