Skip to content

Commit

Permalink
feat: Render MenuGroup as a div instead of fieldset
Browse files Browse the repository at this point in the history
  • Loading branch information
diegohaz committed Apr 22, 2019
1 parent f668ae4 commit 5d4b476
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
5 changes: 2 additions & 3 deletions packages/reakit/src/Menu/MenuGroup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from "react";
import { mergeProps } from "../utils/mergeProps";
import { unstable_createComponent } from "../utils/createComponent";
import { unstable_useOptions } from "../system/useOptions";
Expand All @@ -9,7 +8,7 @@ import { useMenuState, MenuStateReturn } from "./MenuState";

export type MenuGroupOptions = BoxOptions;

export type MenuGroupProps = BoxProps & React.FieldsetHTMLAttributes<any>;
export type MenuGroupProps = BoxProps;

export function useMenuGroup(
options: MenuGroupOptions,
Expand All @@ -30,6 +29,6 @@ const keys: Keys<MenuStateReturn & MenuGroupOptions> = [
useMenuGroup.__keys = keys;

export const MenuGroup = unstable_createComponent({
as: "fieldset",
as: "div",
useHook: useMenuGroup
});
16 changes: 8 additions & 8 deletions packages/reakit/src/Menu/__tests__/MenuGroup-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { MenuGroup } from "../MenuGroup";
test("render", () => {
const { baseElement } = render(<MenuGroup />);
expect(baseElement).toMatchInlineSnapshot(`
<body>
<div>
<fieldset
role="group"
/>
</div>
</body>
`);
<body>
<div>
<div
role="group"
/>
</div>
</body>
`);
});

0 comments on commit 5d4b476

Please sign in to comment.