Skip to content

Commit 2b12cca

Browse files
committed
fix(client): fix island root computation
1 parent eb73ed5 commit 2b12cca

File tree

1 file changed

+13
-5
lines changed
  • apps/client/src/code/pages/page/regions

1 file changed

+13
-5
lines changed

apps/client/src/code/pages/page/regions/region.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,21 @@ export interface IPageRegion {
6969
}
7070

7171
export function getIslandRoot(region: PageRegion): PageRegion {
72-
if (
73-
region.type === 'page' ||
74-
(!region.react.container.spatial && region.react.container.overflow)
75-
) {
72+
if (region.type === 'page') {
7673
return region;
7774
} else {
78-
return region.react.region.react.islandRoot;
75+
const parentRegion =
76+
region?.type === 'note' ? region.react.region : undefined;
77+
78+
if (
79+
parentRegion?.type === 'note' &&
80+
!parentRegion.react.container.spatial &&
81+
parentRegion.react.container.overflow
82+
) {
83+
return parentRegion;
84+
} else {
85+
return region.react.region.react.islandRoot;
86+
}
7987
}
8088
}
8189

0 commit comments

Comments
 (0)