diff --git a/types/react-aria-modal/index.d.ts b/types/react-aria-modal/index.d.ts index e1c0f294d7..ae56a6deac 100644 --- a/types/react-aria-modal/index.d.ts +++ b/types/react-aria-modal/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for react-aria-modal 2.12 +// Type definitions for react-aria-modal 4.0 // Project: https://github.com/davidtheclark/react-aria-modal#readme -// Definitions by: forabi +// Definitions by: gabycperezdias +// forabi // dkrk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -164,6 +165,24 @@ export interface AriaModalProps { * have the function that closes the modal right there, written by you, at your disposal. */ onExit(): any; + + /** + * If true, the modal dialog's focus trap will be paused. + * You won't typically need to use this prop. It used to be that the typical reason for pausing a focus trap was to enable nested focus traps; + * but as of focus-trap v4, the pausing and unpausing of hierachical traps is handled automatically. + */ + focusTrapPaused?: boolean; + + /** + * Customize properties of the focusTrapOptions prop that is passed to the modal dialog's focus trap. + * For example, you can use this prop if you need better control of where focus is returned. + */ + focusTrapOptions?: object; + + /** + * If true, the modal dialog will prevent any scrolling behind the modal window. + */ + scrollDisabled?: boolean; } /** @@ -173,5 +192,5 @@ export type RequiredAriaTypes, U = Pick { - static renderTo(node: HTMLElement | string): void; + static renderTo(node: HTMLElement | string): React.ReactType; } diff --git a/types/react-aria-modal/react-aria-modal-tests.tsx b/types/react-aria-modal/react-aria-modal-tests.tsx index d0a13428a9..58b61849ca 100644 --- a/types/react-aria-modal/react-aria-modal-tests.tsx +++ b/types/react-aria-modal/react-aria-modal-tests.tsx @@ -12,3 +12,12 @@ render( , appContainer ); + +const DisplacedModal = AriaModal.renderTo('#some-id'); + +render( + +

Hello world

+
, + appContainer +);