Skip to content

Commit

Permalink
refactor(show-more): ♻️ add role to collapsibel content
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-moorthy committed May 18, 2022
1 parent 6ff7899 commit 3e1386a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/disclosure/disclosure-collapsible-content.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from "react";
import { flushSync } from "react-dom";
import { RoleOptions, useRole } from "ariakit";
import { DisclosureState } from "ariakit/disclosure";
import {
useEvent,
Expand All @@ -12,7 +13,7 @@ import {
createElement,
createHook,
} from "ariakit-utils/system";
import { As, Options, Props } from "ariakit-utils/types";
import { As, Props } from "ariakit-utils/types";
import raf from "raf";

import {
Expand Down Expand Up @@ -198,6 +199,8 @@ export const useDisclosureCollapsibleContent =
style,
};

props = useRole(props);

return props;
},
);
Expand All @@ -210,7 +213,7 @@ export const DisclosureCollapsibleContent =
});

export type DisclosureCollapsibleContentOptions<T extends As = "div"> =
Options<T> & {
RoleOptions<T> & {
/**
* Object returned by the `useDisclosureState` hook.
*/
Expand Down

1 comment on commit 3e1386a

@vercel
Copy link

@vercel vercel bot commented on 3e1386a May 18, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.