Skip to content

Commit 4312413

Browse files
fix(Page): add ref to use for passing modal portal root
1 parent 08a8d7d commit 4312413

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

packages/core/src/core/page/Page.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,18 @@
2424
import classNames from "classnames";
2525
import { Loading } from "../../components/animations/Animations";
2626
import { Icon } from "../../components/icon/Icon";
27-
import { type ChildrenProp, type IconProps, type TestProps } from "../../types";
27+
import {
28+
type ChildrenProp,
29+
type IconProps,
30+
type RefProp,
31+
type TestProps,
32+
} from "../../types";
2833

29-
export interface PageProps extends IconProps, ChildrenProp, TestProps {
34+
export interface PageProps
35+
extends IconProps,
36+
ChildrenProp,
37+
TestProps,
38+
RefProp<HTMLDivElement> {
3039
/**
3140
* page title
3241
*/
@@ -49,6 +58,7 @@ export interface PageProps extends IconProps, ChildrenProp, TestProps {
4958
* The page component used typically for routes, is a structured layout used within an application to organize and display content in a sectioned format, ensuring a consistent and intuitive user experience.
5059
*/
5160
export const Page = ({
61+
ref,
5262
children,
5363
paper,
5464
title,
@@ -60,17 +70,20 @@ export const Page = ({
6070
loading,
6171
"data-testid": testId,
6272
"data-test-value": testValue,
73+
...rest
6374
}: PageProps) => {
6475
return (
6576
<div
6677
data-testid={testId}
6778
data-test-value={testValue}
6879
data-loading={loading}
6980
className={classNames(
70-
"fabric-page",
81+
"fabric-page relative",
7182
"overflow-hidden grid area-content",
7283
paper && "shadow-paper m-[6px] rounded-capped",
7384
)}
85+
ref={ref}
86+
{...rest}
7487
>
7588
{title && (
7689
<div

0 commit comments

Comments
 (0)