Skip to content
Merged
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion packages/ui-focusable/src/Focusable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: example
console.log(options)
return <span>
<div>
<Button>Focus me!</Button>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no need to associate the button with itself. Just the tooltip is enough:
<Button aria-labelledby="tooltip">Focus me!</Button> Also I suggest to give a more unique ID to items in examples (e.g. focusable-example1-tooltip, who knows that else could use this ID in the docs app

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matyasf I associated the button with itself because otherwise, the button's title would not be announced—only the "tooltip" text would be.
(The first example in Tooltip works similarly; the tooltip text is read after the button's title.)

<Button aria-labelledby="focusable-example1-button focusable-example1-tooltip" id="focusable-example1-button">Focus me!</Button>
</div>
{options.focused && (
<ContextView
Expand All @@ -26,6 +26,8 @@ type: example
padding="small"
borderWidth="small"
display="block"
id="focusable-example1-tooltip"
role="tooltip"
>
I&#39;m focused!
</ContextView>
Expand Down
Loading