Skip to content

Commit 30b6cd0

Browse files
committed
docs(ui-tray): fix Tray example to make CloseButton preceed the Heading in Tray
INSTUI-4656
1 parent 5eb694e commit 30b6cd0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/ui-tray/src/Tray/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ The Tray is an actionable container that is triggered by click and does not need
2525
renderCloseButton() {
2626
return (
2727
<Flex>
28-
<Flex.Item shouldGrow shouldShrink>
29-
<Heading>Hello</Heading>
30-
</Flex.Item>
3128
<Flex.Item>
3229
<CloseButton
3330
placement="end"
@@ -36,6 +33,9 @@ The Tray is an actionable container that is triggered by click and does not need
3633
onClick={this.hideTray}
3734
/>
3835
</Flex.Item>
36+
<Flex.Item shouldGrow shouldShrink>
37+
<Heading>Hello</Heading>
38+
</Flex.Item>
3939
</Flex>
4040
)
4141
}
@@ -86,9 +86,6 @@ The Tray is an actionable container that is triggered by click and does not need
8686

8787
const renderCloseButton = () => (
8888
<Flex>
89-
<Flex.Item shouldGrow shouldShrink>
90-
<Heading>Hello</Heading>
91-
</Flex.Item>
9289
<Flex.Item>
9390
<CloseButton
9491
placement="end"
@@ -97,6 +94,9 @@ The Tray is an actionable container that is triggered by click and does not need
9794
onClick={hideTray}
9895
/>
9996
</Flex.Item>
97+
<Flex.Item shouldGrow shouldShrink>
98+
<Heading>Hello</Heading>
99+
</Flex.Item>
100100
</Flex>
101101
)
102102

@@ -159,7 +159,7 @@ type: embed
159159
<Figure.Item>Keyboard focus must be set in the tray when it appears; usually on the first interactive element</Figure.Item>
160160
<Figure.Item>Trays must contain keyboard focus until they’re closed. This is to ensure that keyboard or screen reader users won't mistakenly interact with background content that is meant to be hidden or inaccessible</Figure.Item>
161161
<Figure.Item>When a user closes a tray, focus must return to a logical place within the page. This is usually the element that triggered opening the tray</Figure.Item>
162-
<Figure.Item>We recommend that trays begin with a heading (typically H2)</Figure.Item>
162+
<Figure.Item>We recommend that trays begin with a heading (typically H2). However, when configuring the component, the button to close the Tray should precede the heading. This ensures screen readers announce the Tray's content in a logical order.</Figure.Item>
163163
</Figure>
164164
</Guidelines>
165165
```

0 commit comments

Comments
 (0)