-
Notifications
You must be signed in to change notification settings - Fork 2.9k
ContextualMenuItem: adding secondaryText #4788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
01ab053
7c1d301
4814754
f4a55d2
e78431a
c1c3b32
f282f53
7922e3b
6050417
a2c2da4
d5b8650
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "office-ui-fabric-react", | ||
| "comment": "Add secondaryText to ContextualMenuItem to render on the right of item.name (text)", | ||
| "type": "minor" | ||
| } | ||
| ], | ||
| "packageName": "office-ui-fabric-react", | ||
| "email": "[email protected]" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,13 @@ | ||
| import { | ||
| concatStyleSets, | ||
| FontSizes, | ||
| FontWeights, | ||
| IRawStyle, | ||
| ITheme, | ||
| concatStyleSets, | ||
| getFocusStyle, | ||
| HighContrastSelector | ||
| HighContrastSelector, | ||
| IRawStyle, | ||
| ITheme | ||
| } from '../../Styling'; | ||
| import { IContextualMenuStyles, IMenuItemStyles } from './ContextualMenu.types'; | ||
|
|
||
| import { memoizeFunction } from '../../Utilities'; | ||
|
|
||
| const ContextualMenuItemHeight = '32px'; | ||
|
|
@@ -117,6 +116,11 @@ export const getMenuItemStyles = memoizeFunction(( | |
| overflow: 'hidden', | ||
| whiteSpace: 'nowrap' | ||
| }, | ||
| secondaryText: { | ||
| color: theme.palette.neutralTertiary, | ||
| paddingLeft: '20px', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is handled automatically. You can test it through
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool! Thanks, @dzearing! |
||
| textAlign: 'right', | ||
| }, | ||
| icon: { | ||
| display: 'inline-block', | ||
| minHeight: '1px', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
secondary text is here, but isn't being used in button.
If the idea is to replace description with secondaryText, lets start supporting both (in BaseButton.tsx and style files) so that we can deprecate description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, sorry no I forgot to remove this. Am adding vr-tests now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought I am not sure. Without this addition I am unable to add this property to ContextualMenu.styles.ts (since this derives from IMenuStyles which falls under ButtonTypes.ts (namely,
IMenuItemStyles extends IButtonStyles). Is this fine? Or how do you suggest adding it properly to just effect ContextualMenuItems?