Skip to content

Commit

Permalink
chore: mrege fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bvandercar-vt committed Jan 27, 2025
1 parent 58ae955 commit ce42430
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions packages/core/src/components/overlay/overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,18 +215,11 @@ export class Overlay extends AbstractPureComponent<OverlayProps, OverlayState> {
}

// decorate the child with a few injected props
const tabIndex = this.props.enforceFocus || this.props.autoFocus ? 0 : undefined;
const decoratedChild =
typeof child === "object" ? (
React.cloneElement(child as React.ReactElement, {
className: classNames((child as React.ReactElement).props.className, Classes.OVERLAY_CONTENT),
tabIndex,
})
) : (
<span className={Classes.OVERLAY_CONTENT} tabIndex={tabIndex}>
{child}
</span>
);
const decoratedChild = isReactElement(child) ? (
React.cloneElement(child, { className: classNames(child.props.className, Classes.OVERLAY_CONTENT) })
) : (
<span className={Classes.OVERLAY_CONTENT}>{child}</span>
);

const { onOpening, onOpened, onClosing, transitionDuration, transitionName } = this.props;

Expand Down

0 comments on commit ce42430

Please sign in to comment.