-
Notifications
You must be signed in to change notification settings - Fork 221
docs(overlay): a11y docs update #5409
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
base: main
Are you sure you want to change the base?
Conversation
|
Branch previewReview the following VRT differencesWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
If the changes are expected, update the |
Tachometer resultsCurrently, no packages are changed by this PR... |
d6f0e46
to
3cd6388
Compare
packages/overlay/README.md
Outdated
|
||
### Modal | ||
##### Modal |
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.
Could we do each of the types in an <sp-tabs>
element? It will save space and allow easier copmparison.
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.
great idea!!
packages/overlay/README.md
Outdated
|
||
#### Keyboard Navigation | ||
|
||
- ESC key closes overlays in reverse order of opening |
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.
- ESC key closes overlays in reverse order of opening | |
- <kbd>Escape</kbd> key closes overlays in reverse order of opening |
packages/overlay/README.md
Outdated
</sp-overlay> | ||
``` | ||
|
||
### Advanced Topics |
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.
Can we move advanced topics above Accessibility? That way consumers always know to look for Accessibility at the bottom.
|
||
### Overlay types | ||
#### Types |
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.
This is soooooooooo very helpful. Thanks for adding this section.
packages/overlay/README.md
Outdated
## Nested Overlays | ||
### Accessibility | ||
|
||
#### Nested Overlays |
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.
Thanks for adding this!
packages/overlay/README.md
Outdated
|
||
When a `triggerElement` is present, either through an ID reference established via the `trigger` attribute or by directly setting the `triggerElement` property, a chain on configuration begins: | ||
|
||
- **if a `triggerInteraction` is available**, either through the `id@interaction` IDL on the `trigger` attribute or directly setting the `triggerInteraction` property, the `<sp-overlay>` will be bound to the resolved `triggerElement` via the `triggerInteraction` provided |
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.
I wonder if putting this information into a table instead of a list may make it easier to mentally process...
packages/overlay/README.md
Outdated
@@ -493,3 +477,107 @@ WebKit clips `position: fixed` elements within containers that have all of: | |||
3. `z-index` greater than zero | |||
|
|||
If you notice overlay clipping _only_ in Safari, this is likely the culprit. The solution is to break up the conditions into separate elements to avoid triggering WebKit's bug. For example, leaving relative positioning and z-index on the outermost container while creating an inner container that enforces the overflow rules. | |||
|
|||
### Integration Patterns |
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.
Can we move this section before the Advanced section?
#### Placement | ||
|
||
When using the `placement` attribute of an `<overlay-trigger>` (`"top" |"top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "right" | "right-start" | "right-end" | "left" | "left-start" | "left-end"`), you can suggest to the overlay in which direction relative to the trigger that the content should display. When there is adequate room for the content to display in the specified direction, it will do so. When adequate room is not available, the overlaid content will calculate the direction in which it has the most room to be displayed and use that direction. | ||
|
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.
Do we want sp-tabs
with examples of some of these placement options?
#### Type | ||
|
||
The `type` attribute of an `<overlay-trigger>` element outlines how the element's "click" content should appear in the tab order. `inline` will insert the overlay after the trigger; from here, forward tabbing targets the next logical element, and backward/shift tabbing returns to the target. `replace` will insert the overlay into the page as if it were the trigger; from here, forward tabbing targets the next logical element, and backward/shift tabbing targets the logical element prior to the target. Finally, `modal` will open the content in a tab order fully separate from the original content flow and trap the tab order within that content until the required interaction is complete. | ||
|
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.
Do we want sp-tabs
with examples of some of these type options?
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.
yus!
ee09cc5
to
2faeeb2
Compare
2faeeb2
to
499d562
Compare
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.
A few suggestions for heading cases and wording but otherwise this is a great update with lots of improvements in it.
packages/overlay/imperative-api.md
Outdated
@@ -60,33 +62,39 @@ type OverlayOptions = { | |||
}; | |||
``` | |||
|
|||
### delayed | |||
#### delayed |
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.
#### delayed | |
#### `delayed` |
Should these attribute headings be in monospace? Just not sure of the convention used in other docs.
packages/overlay/imperative-api.md
Outdated
### Using a virtual trigger | ||
#### Types | ||
|
||
The `type` of an Overlay outlines a number of things about the interaction model within which it works which are described in the [Overlay Types](https://opensource.adobe.com/spectrum-web-components/components/overlay/#overlay-types). |
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.
The `type` of an Overlay outlines a number of things about the interaction model within which it works which are described in the [Overlay Types](https://opensource.adobe.com/spectrum-web-components/components/overlay/#overlay-types). | |
The `type` of an Overlay outlines a number of things about the interaction model within which it works which are described in the [Overlay types](https://opensource.adobe.com/spectrum-web-components/components/overlay/#overlay-types). |
Just updated the heading to sentence case. Same feedback for Advanced Topics
below.
packages/overlay/overlay-trigger.md
Outdated
### Click content only | ||
|
||
This example only delivers content via the "click" interaction and leverages both `placement` and `type` attributes to customize the visual relationship of the content to the page and its position in the tab order. | ||
Here a default `<overlay-trigger>` manages content that is triggered by "click" and "hover" interactions. |
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.
Here a default `<overlay-trigger>` manages content that is triggered by "click" and "hover" interactions. | |
In this example, a default `<overlay-trigger>` manages content that is triggered by "click" and "hover" interactions. |
|
||
When working with a large amount of content that lives whithin an overlay, a page may encounter performance issues for placing a large amount of content within `<sp-overlay>` or `<overlay-trigger>` elements. To avoid this, an empty `<sp-overlay>` could be used instead. When triggered, the `<sp-overlay>` element will dispatch `slottable-request` just before it begins to open and just after it finished closing. When handling these events the contents of an overlay can be lazily rendered into the `<sp-overlay>` element as it opens and then, as needed, removed from the DOM once the overlay has closed. | ||
The `slottable-request` event provides a performance optimization mechanism for overlays with large content. Instead of keeping large amounts of content in the DOM at all times, an empty `<sp-overlay>` can be used initially. The overlay will dispatch `slottable-request` events just before opening and after closing, allowing content to be lazily rendered and removed as needed. |
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.
Nice! What a cool feature!
@@ -82,4 +87,63 @@ When leveraging the `<sp-overlay>` in a javascript only context, you can leverag | |||
}); | |||
</script> | |||
|
|||
Starting with no DOM in the `<sp-overlay>` element and returning to that when the Overlay element is no longer showing can support an application in releasing memory back to other activities. | |||
### Options | |||
|
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.
A note to check title cases for this doc as well. Thanks!
* @fires sp-opened - announces that an overlay has completed any entry animations | ||
* @fires sp-closed - announce that an overlay has compelted any exit animations | ||
* @fires slottable-request - requests to add or remove slottable content | ||
* | ||
* @attr {string} placement - The placement of the overlay relative to the trigger |
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.
Great enhancement, thank you!
499d562
to
2311a0e
Compare
Description
Improving the accessibility documentation of components.
Related issue(s)
Motivation and context
Documentation should provide more information and examples that demonstrate how to use the components accessibly.
How has this been tested?
Review overlay docs
Do the docs examples give enough context to test for accessibility?
Do the docs examples and text provide information on how to use the component accessibly?
If the component is to be used in the context of another component, do the examples include how that component is used accessibly in that context?
Are the docs headings logical and consistent across these components? You can use the WAVE browser extension's Structure tab to review heading structure.
Did it pass in Desktop?
Did it pass in Mobile?
Did it pass in iPad?
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.