Skip to content

Commit

Permalink
chore(popover): update docs to clarify autoFocus usage (uber#4457)
Browse files Browse the repository at this point in the history
Autofocus should always be managed via Popover's autoFocus prop, rather
than by adding the autofocus attribute directly to Popover's contents.
  • Loading branch information
lhbrennan authored Aug 16, 2021
1 parent ccbcf28 commit b3ea875
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion documentation-site/components/yard/config/popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const PopoverConfig: TConfig = {
value: true,
type: PropTypes.Boolean,
description:
'If true, focus will shift to the first interactive element within the popover.',
"If true, focus will shift to the first interactive element within the popover. Avoid adding autofocus directly to the popover's contents, as this will cause unexpected behavior.",
hidden: true,
},
accessibilityType: {
Expand Down
3 changes: 3 additions & 0 deletions documentation-site/pages/components/popover.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ content view after being triggered by a click-event (or hover) such as a button,
icon. Popovers can contain range of content from simple text strings to inputs, or lightly
structured content and imagery/illustration. It’s usage depends on the context.

Note that autofocus should be managed using Popover's autoFocus prop. Avoid adding autofocus
directly to Popover's contents, as this will cause unexpected behavior.

## When to use

- Describe the difference between visually similar elements.
Expand Down

0 comments on commit b3ea875

Please sign in to comment.