Skip to content

Commit 3e1386a

Browse files
committed
refactor(show-more): ♻️ add role to collapsibel content
1 parent 6ff7899 commit 3e1386a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/disclosure/disclosure-collapsible-content.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from "react";
22
import { flushSync } from "react-dom";
3+
import { RoleOptions, useRole } from "ariakit";
34
import { DisclosureState } from "ariakit/disclosure";
45
import {
56
useEvent,
@@ -12,7 +13,7 @@ import {
1213
createElement,
1314
createHook,
1415
} from "ariakit-utils/system";
15-
import { As, Options, Props } from "ariakit-utils/types";
16+
import { As, Props } from "ariakit-utils/types";
1617
import raf from "raf";
1718

1819
import {
@@ -198,6 +199,8 @@ export const useDisclosureCollapsibleContent =
198199
style,
199200
};
200201

202+
props = useRole(props);
203+
201204
return props;
202205
},
203206
);
@@ -210,7 +213,7 @@ export const DisclosureCollapsibleContent =
210213
});
211214

212215
export type DisclosureCollapsibleContentOptions<T extends As = "div"> =
213-
Options<T> & {
216+
RoleOptions<T> & {
214217
/**
215218
* Object returned by the `useDisclosureState` hook.
216219
*/

0 commit comments

Comments
 (0)