Add Keytips to office-ui-fabric-react#4629
Conversation
- Add keytipProps to BaseButton - Update KeytipLayer example to use new keytipProps, comment out some of it
- Add KeytipConfig files, use for setup in KeytipLayer
- Setup offset for keytips correctly - Add keytip offset example
- Remove keytipLink and previous overflow logic, and tests
- Update tests - Add KeytipLayer styles to prioritize that layer above all others
- Add split button in contextual menu to example
…flexibility - Add more components to the KeytipLayer example - Add ariaDescribedBy to KeytipHost to do automatic appending
- Also unsets when item gets moved out of the overflow - Add logic in places to merge the overflow sequence if necessary - Fix tests that used let instead of const - Add persisted attribute to tree node to filter out when showing keytips
…le function ordering - Fix broken Keytip examples
| pauseBreak = 19, | ||
| capslock = 20, | ||
| escape = 27, | ||
| space = 32, |
There was a problem hiding this comment.
What exactly is going on in this file?
|
|
||
| // Events | ||
| export namespace KeytipEvents { | ||
| export const KEYTIP_ADDED = 'keytipAdded'; |
There was a problem hiding this comment.
can you move the keytips stuff out of the utilities package? This will be included in the PLT1 bundle. It should only be in the keytips project in oufr.
| export * from './IStyleFunction'; | ||
| export * from './KeyCodes'; | ||
| export * from './KeytipConstants'; | ||
| export * from './KeytipTransitionModifier'; |
There was a problem hiding this comment.
None of the keytip work belongs in @uifabric/utilities.
| up: 38, | ||
| right: 39, | ||
| down: 40, | ||
| insert: 45, |
| /** | ||
| * The background color for a disabled keytip. | ||
| */ | ||
| keytipBackgroundDisabled: string; |
There was a problem hiding this comment.
it is weird that there is a background for a disabled keytip but nothing else...
| aria-haspopup={ true } | ||
| aria-expanded={ this._isExpanded } | ||
| aria-pressed={ this.props.checked } | ||
| aria-describedby={ ariaDescribedBy + (keytipAttributes['aria-describedby'] || '') } |
There was a problem hiding this comment.
are you guaranteed that ariaDescribedBy and the aria-describedby from keytipAttributes will have a space in between them? Consider something like ${ariaDescribedby} ${keytipAttributes['ariadescribedby']}
There was a problem hiding this comment.
The beginning space is added in the getAriaDescribedBy function
| import { IStyleFunction, IPoint } from '../../Utilities'; | ||
| import { mergeStyleSets } from '../../Styling'; | ||
|
|
||
| export const getStyles = (props: IKeytipStyleProps): IKeytipStyles => { |
There was a problem hiding this comment.
I'm not seeing any HC styling for keytips, when disabled the color should be grayText and the opacity should be 1
- Add HC styling for keytips when disabled - Restored missing KeyCodes
| $listItemBackgroundCheckedHoveredColor: "[theme:listItemBackgroundCheckedHovered, default: #d0d0d0]"; | ||
|
|
||
| /* Keytips */ | ||
| $keytipDisabledTextColor: "[theme:keytipDisabledText, default: #b1b1b1]"; |
There was a problem hiding this comment.
keytips should not get their own semantic slot
semantic slots are not for each feature to have their own, but for each concept
can you reuse an existing concept?
There was a problem hiding this comment.
@phkuo How can I reuse an existing one if the color isn't shared with anyone else? I thought your previous comments in the other PRs (the part 1 and 2 ones) said to follow this pattern
There was a problem hiding this comment.
All colors should be one that's in our palette, we shouldn't be adding things with bespoke colors.
For now, just use one of the palette slots from here:
https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/common/_themeOverrides.scss
There was a problem hiding this comment.
Now using neutralTertiaryAlt instead which is very close to our original color
|
Can you add a screenshot? |
| * This category covers all kinds of lists, whether they're typical one-item-per-row lists (like DetailsList) or ones with a tiled layout. | ||
| * | ||
| * ## Keytips | ||
| * |
There was a problem hiding this comment.
Oversight, will remove
- Created arraysAreEqual utility function
|
Hi @kelseyyoung, because the Command Bar component you modified was replaced by the version in the I've therefore marked this PR as requiring follow up in 6.0. I will coordinate with you offline on what this means. (cc @dzearing) |
|
Also @micahgodbolt for FYI. |
Pull request checklist
$ npm run changeDescription of changes
Screenshot of keytips

Focus areas to test
(optional)