Skip to content

Commit

Permalink
docs:api
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Dec 24, 2024
1 parent 39fdca3 commit 2885c2d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions packages/react/src/utils/InternalBackdrop.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as React from 'react';
import PropTypes from 'prop-types';

/**
* @ignore - internal component.
*/
export function InternalBackdrop(props: InternalBackdrop.Props) {
function InternalBackdrop(props: InternalBackdrop.Props) {
const { inert = false } = props;
return (
<div
role="presentation"
Expand All @@ -19,7 +21,7 @@ export function InternalBackdrop(props: InternalBackdrop.Props) {
// conditionally rendering the backdrop on `open` and using exit animations.
// If the popup reopens before the exit animation finishes, the backdrop
// receives this attribute, breaking outside click behavior.
pointerEvents: props.inert ? 'none' : undefined,
pointerEvents: inert ? 'none' : undefined,
}}
/>
);
Expand All @@ -34,3 +36,17 @@ namespace InternalBackdrop {
inert?: boolean;
}
}

InternalBackdrop.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* Whether the backdrop should be inert (not block pointer events).
* @default false
*/
inert: PropTypes.bool,
} as any;

export { InternalBackdrop };

0 comments on commit 2885c2d

Please sign in to comment.