File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
apps/roam/src/components/canvas Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -936,22 +936,14 @@ const renderTldrawCanvasHelper = ({
936936 childFromRoot . parentElement &&
937937 ! childFromRoot . hasAttribute ( TLDRAW_DATA_ATTRIBUTE )
938938 ) {
939+ rootElement . setAttribute ( TLDRAW_DATA_ATTRIBUTE , "true" ) ;
939940 childFromRoot . setAttribute ( TLDRAW_DATA_ATTRIBUTE , "true" ) ;
940941 const parentEl = childFromRoot . parentElement ;
941942 parentEl . appendChild ( canvasWrapperEl ) ;
942943 canvasWrapperEl . style . minHeight = minHeight ;
943944 canvasWrapperEl . style . height = height ;
944945 }
945946
946- // console.log(
947- // "blockChildrenContainer.parentElement",
948- // articleChildren.parentElement,
949- // );
950- // articleChildren.parentElement?.insertBefore(
951- // canvasWrapperEl,
952- // articleChildren.nextSibling,
953- // );
954-
955947 const unmount = renderWithUnmount (
956948 < ExtensionApiContextProvider { ...onloadArgs } >
957949 < TldrawCanvas title = { title } />
@@ -963,6 +955,7 @@ const renderTldrawCanvasHelper = ({
963955 return ( ) => {
964956 originalUnmount ( ) ;
965957 childFromRoot . removeAttribute ( TLDRAW_DATA_ATTRIBUTE ) ;
958+ rootElement . removeAttribute ( TLDRAW_DATA_ATTRIBUTE ) ;
966959 canvasWrapperEl . remove ( ) ;
967960 } ;
968961} ;
Original file line number Diff line number Diff line change 22export const TLDRAW_DATA_ATTRIBUTE = "dg-tldraw-canvas-wrapper" ;
33export default `
44 /* Hide Roam Blocks only when canvas is present */
5- .roam-article .rm-block-children [${ TLDRAW_DATA_ATTRIBUTE } ="true"] {
5+ .roam-article[${ TLDRAW_DATA_ATTRIBUTE } ="true"] .rm-block-children {
66 display: none;
77 }
88
99 /* Hide Roam Blocks in sidebar when canvas is present */
10- .rm-sidebar-outline .rm-block-children [${ TLDRAW_DATA_ATTRIBUTE } ="true"] {
10+ .rm-sidebar-outline[${ TLDRAW_DATA_ATTRIBUTE } ="true"] .rm-block-children {
1111 display: none;
1212 }
1313
You can’t perform that action at this time.
0 commit comments