Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HoverCard: Add more documentation and fix accessibility bug. (#5866)
* Adds a conditional for 'data-is-focusable' for the root node. * Adds more documentation. * More documentation... * Cleanup code. * Rush change log. * Snapshot updates.
- Loading branch information
Showing
11 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
common/changes/office-ui-fabric-react/v-vibr-HoverAccessibility_2018-08-09-01-08.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "office-ui-fabric-react", | ||
"comment": "HoverCard: Adds more documentation and adds a focus stop on root to eliminate an edge case when target is not provided the focus listener was not firing at all.", | ||
"type": "patch" | ||
} | ||
], | ||
"packageName": "office-ui-fabric-react", | ||
"email": "v-vibr@microsoft.com" | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/office-ui-fabric-react/src/components/HoverCard/HoverCard.checklist.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/office-ui-fabric-react/src/components/HoverCard/docs/HoverCardDonts.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- If not specifying `target` prop and using the HoverCard as a wrapper, don't provide `data-is-focusable='true'` attribute to the root of the wrapped child. When no target given, HoverCard will use it's root as a target and become the focusable element with a `focus` listener attached to it. See Example 1. |
2 changes: 2 additions & 0 deletions
2
packages/office-ui-fabric-react/src/components/HoverCard/docs/HoverCardDos.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Set `trapFocus` prop to **true** if you want to render the content of the HoverCard in a FocusTrapZone for accessibility reasons. | ||
- Set `setInitialFocus` prop to **true** if when opening the card your intention is to set focus on the first focusable element in the card. Works in pair with the `trapFocus` prop. |
7 changes: 6 additions & 1 deletion
7
packages/office-ui-fabric-react/src/components/HoverCard/docs/HoverCardOverview.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
HoverCards supplement content associated with a specific data element. | ||
HoverCards supplement content associated with a specific data element. | ||
|
||
Two scenarios to consider for your own use case from an accessibility point of view when deciding how the card should open and it's behavior after it opened: | ||
|
||
- Tabbing with a keyboard to the element triggering the HoverCard to open on focus. In this case no further navigation within the card is available and navigating to the next element will close the card. See Example 1. | ||
- Tabbing with a keyboard to the element triggering the HoverCard and wait to open till the hotKey is depressed. When card is opened it will automatically focus the first focusable element of the card content. See Example 2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters