Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2ffef62
made spin button and base button menu option un-focusable
Mar 8, 2018
979da51
added spin button test
Mar 9, 2018
e4ab4b4
added split button contextual menu change
Mar 9, 2018
3d95aca
got rid of un-needed code
Mar 9, 2018
64bc57b
added change files
Mar 9, 2018
e08bf24
added abillitiy to not focus on primary button for split button, but …
Mar 9, 2018
c16992b
enter on focus on split button trigger primary action
Mar 9, 2018
7bea2c0
added split button style for disabled
Mar 9, 2018
62cb458
prevent opening submenu if item is disabled
Mar 9, 2018
efb7439
tighten restrictions on opening split buttons to open with alt + down
Mar 9, 2018
f803332
refactored button name and fixed test
Mar 10, 2018
b2a4475
updated bundle size
Mar 13, 2018
b1f2c39
Merge branch 'master' into focus2
chang47 Mar 13, 2018
976c67f
changed on menu item click to bw able to take in a keyboard event
Mar 13, 2018
d3e1426
Merge branch 'focus2' of https://github.com/chang47/office-ui-fabric-…
Mar 13, 2018
0aaefaa
updated package json
Mar 13, 2018
bbc370f
fixed weird tabbing
Mar 13, 2018
0fc2cc6
changed way we structured the focus
Mar 13, 2018
965a8e9
added stop propagation
Mar 14, 2018
2603277
resolved merge conflicts
Mar 15, 2018
aaa77c3
resolved merge conflict
Mar 16, 2018
ad6e5df
changed split button container key down to work with other buttons now
Mar 16, 2018
e01436a
update bundle size
Mar 16, 2018
a33679e
added correct split button container styles
Mar 21, 2018
93ba4ae
removed unnecessary attribute
Mar 21, 2018
d19e1a6
fixed focusing on menu button when primary button is disabled
Mar 21, 2018
24ae278
added change to focus
Mar 21, 2018
0e7d887
resolved merge conflict
Mar 21, 2018
619711d
added aria hidden
Mar 21, 2018
276fe96
fixed span location and moved TODO
Mar 21, 2018
d4436d4
added support to focus on whole container in split button for context…
Mar 22, 2018
843d758
added comment
Mar 22, 2018
9186034
fixed styling issues with buttons
Mar 23, 2018
c95f842
fixed style problems for contextual split button where content is cen…
Mar 27, 2018
5261c32
merged
Mar 27, 2018
690efcc
reverted change
Mar 27, 2018
c985bc4
added appropriate change file
Mar 27, 2018
37e7ec7
Update contextualMenuAlignSplitButton_2018-03-27-18-13.json
dzearing Mar 27, 2018
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
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "ContextualMenu / Split Button: Fixed styling problems For centered button content.",
"type": "minor"
}
],
"packageName": "office-ui-fabric-react",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -504,4 +504,9 @@ export interface IButtonStyles {
* Style override for the SplitButton FlexContainer.
*/
splitButtonFlexContainer?: IStyle;

/**
* Style override for focus on the the SplitButton Container
*/
splitButtonFlexContainerFocus?: IStyle;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface IMenuItemClassNames {
subMenuIcon: string;
label: string;
splitContainer: string;
splitContainerFocus: string;
splitPrimary: string;
splitMenu: string;
linkContentMenu: string;
Expand Down Expand Up @@ -200,11 +201,14 @@ export const getItemClassNames = memoizeFunction((
],
splitContainer: [
styles.splitButtonFlexContainer,
],
splitContainerFocus: [
styles.splitButtonFlexContainerFocus,
!disabled && !checked && [{
selectors: {
'.ms-Fabric.is-focusVisible &:focus, .ms-Fabric.is-focusVisible &:focus:hover': styles.rootFocused,
}
}]
],
]
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,17 @@ export const getMenuItemStyles = memoizeFunction((
flexShrink: '0',
fontSize: FontSizes.mini
},
splitButtonFlexContainer: [
getFocusStyle(theme), {
display: 'flex',
height: ContextualMenuItemHeight,
flexWrap: 'nowrap',
justifyContent: 'center',
alignItems: 'center',
}],
splitButtonSeparator: {}
splitButtonFlexContainer: {
display: 'flex',
height: ContextualMenuItemHeight,
flexWrap: 'nowrap',
justifyContent: 'center',
alignItems: 'center',
},
splitButtonSeparator: {},
splitButtonFlexContainerFocus: [
getFocusStyle(theme)
]
};

return concatStyleSets(menuItemStyles);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ export class ContextualMenu extends BaseComponent<IContextualMenuProps, IContext
}
role={ 'button' }
aria-labelledby={ item.ariaLabel }
className={ classNames.splitContainer }
className={ classNames.splitContainerFocus }
aria-disabled={ this._isItemDisabled(item) }
aria-haspopup={ true }
aria-describedby={ item.ariaDescription }
Expand All @@ -611,7 +611,7 @@ export class ContextualMenu extends BaseComponent<IContextualMenuProps, IContext
>
<span
aria-hidden={ true }
style={ { display: 'flex', height: '100%' } }
className={ classNames.splitContainer }
>
{ this._renderSplitPrimaryButton(item, classNames, index, hasCheckmarks!, hasIcons!) }
{ this._renderSplitDivider(item) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ function getMenuItemClassNames(): IMenuItemClassNames {
subMenuIcon: 'subMenuIcon',
label: 'label',
splitContainer: 'splitContainer',
splitContainerFocus: 'splitContainerFocus',
splitPrimary: 'splitPrimary',
splitMenu: 'splitMenu',
linkContentMenu: 'linkContentMenu',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ShallowWrapper {
"linkContentMenu": "linkContentMenu",
"root": "root",
"splitContainer": "splitContainer",
"splitContainerFocus": "splitContainerFocus",
"splitMenu": "splitMenu",
"splitPrimary": "splitPrimary",
"subMenuIcon": "subMenuIcon",
Expand Down Expand Up @@ -141,6 +142,7 @@ ShallowWrapper {
"linkContentMenu": "linkContentMenu",
"root": "root",
"splitContainer": "splitContainer",
"splitContainerFocus": "splitContainerFocus",
"splitMenu": "splitMenu",
"splitPrimary": "splitPrimary",
"subMenuIcon": "subMenuIcon",
Expand Down Expand Up @@ -287,6 +289,7 @@ ShallowWrapper {
"linkContentMenu": "linkContentMenu",
"root": "root",
"splitContainer": "splitContainer",
"splitContainerFocus": "splitContainerFocus",
"splitMenu": "splitMenu",
"splitPrimary": "splitPrimary",
"subMenuIcon": "subMenuIcon",
Expand Down Expand Up @@ -404,6 +407,7 @@ ShallowWrapper {
"linkContentMenu": "linkContentMenu",
"root": "root",
"splitContainer": "splitContainer",
"splitContainerFocus": "splitContainerFocus",
"splitMenu": "splitMenu",
"splitPrimary": "splitPrimary",
"subMenuIcon": "subMenuIcon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,42 @@ export class ContextualMenuSubmenuExample extends React.Component<any, IContextu
],
},
name: 'Share'
},
{
key: 'shareSplit',
onClick: () => alert('Split buttons!'),
split: true,
subMenuProps: {
items: [
{
key: 'sharetotwittersplit',
name: 'Share to Twitter',
},
{
key: 'sharetofacebooksplit',
name: 'Share to Facebook',
},
{
key: 'sharetoemailsplit',
name: 'Share to Email',
subMenuProps: {
items: [
{
key: 'sharetooutlooksplit_1',
name: 'Share to Outlook',
title: 'Share to Outlook',
},
{
key: 'sharetogmailsplit_1',
name: 'Share to Gmail',
title: 'Share to Gmail',
}
],
},
},
],
},
name: 'Share w/ Split'
}
]
}
Expand Down