Skip to content
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

Updated documentation regarding getMenuProps #535

Merged
merged 1 commit into from
Aug 7, 2018
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
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -627,14 +627,18 @@ This method should be applied to the element which contains your list of items.
Typically, this will be a `<div>` or a `<ul>` that surrounds a `map` expression.
This handles the proper ARIA roles and attributes.

Required properties:
Optional properties:

- `refKey`: if you're rendering a composite component, that component will need
to accept a prop which it forwards to the root DOM element. Commonly, folks
call this `innerRef`. So you'd call: `getMenuProps({refKey: 'innerRef'})` and
your composite component would forward like: `<ul ref={props.innerRef} />`

Optional properties:
your composite component would forward like: `<ul ref={props.innerRef} />`.
However, if you are just rendering a primitive component like `<div>`, there
is no need to specify this property.

Please keep in mind that menus, for accessiblity purposes, should always be
rendered, regardless of whether you hide it or not. Otherwise, `getMenuProps`
may throw error if you unmount and remount the menu.

- `aria-label`: By default the menu will add an `aria-labelledby` that refers
to the `<label>` rendered with `getLabelProps`. However, if you provide
Expand Down