Skip to content

Commit 64836e6

Browse files
resolve content overflow issue
1 parent 4fdbe3f commit 64836e6

1 file changed

Lines changed: 21 additions & 22 deletions

File tree

App/frontend-app/src/components/documentViewer/documentViewer.tsx

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ const useStyles = makeStyles({
2525
maxWidth: "none",
2626
width: "95%",
2727
...shorthands.borderRadius("1rem"),
28+
display: "flex",
29+
flexDirection: "column",
30+
overflow: "hidden",
2831
},
2932
tabList: {
3033
alignItems: "flex-start",
@@ -36,7 +39,7 @@ const useStyles = makeStyles({
3639
},
3740

3841
aiKnowledgeTab:{
39-
height:"calc(100vh - 150px) !important",
42+
height:"100%",
4043
overflow:"auto"
4144
}
4245
});
@@ -223,7 +226,7 @@ export function DocDialog(
223226
return (
224227
<Dialog open={isOpen}>
225228
<DialogSurface className={styles.dialog}>
226-
<div className="flex">
229+
<div className="flex" style={{ flexShrink: 0 }}>
227230
<DialogTitleBar
228231
metadata={metadata}
229232
selectedPage={selectedPage}
@@ -242,26 +245,22 @@ export function DocDialog(
242245
/>
243246
</div>
244247

245-
<DialogBody style={{ height: "100%", width: "100%" }}>
248+
<DialogBody style={{ display: "flex", flexDirection: "column", flex: 1, minHeight: 0, width: "100%", overflow: "hidden", padding: 0 }}>
246249
{selectedTab === "Document" && (
247-
<div className="flex h-[150%] w-[200%] justify-between" style={{height:'100vh'}}>
248-
<div className="mr-5 h-[80%] w-[75%] shadow-xl">
249-
<IFrameComponent
250-
className="h-[100%]"
251-
metadata={metadata}
252-
urlWithSasToken={iframeSrc}
253-
iframeKey={iframeKey}
254-
/>
255-
</div>
256-
<div className="w-[25%]" style={{height:'80vh', overflowX: 'hidden'}}>
257-
<DialogContentComponent
258-
className=""
259-
metadata={metadata}
260-
allChunkTexts={allChunkTexts}
261-
isExpanded={isExpanded}
262-
setIsExpanded={setIsExpanded}
263-
/>
264-
</div>
250+
<div className="flex shadow-xl" style={{ flex: 1, minHeight: 0, overflow: "hidden" }}>
251+
<IFrameComponent
252+
className="h-[100%] w-[70%]"
253+
metadata={metadata}
254+
urlWithSasToken={iframeSrc}
255+
iframeKey={iframeKey}
256+
/>
257+
<DialogContentComponent
258+
className="w-[30%] overflow-y-auto flex-shrink-0"
259+
metadata={metadata}
260+
allChunkTexts={allChunkTexts}
261+
isExpanded={isExpanded}
262+
setIsExpanded={setIsExpanded}
263+
/>
265264
</div>
266265
)}
267266
{/*
@@ -278,7 +277,7 @@ export function DocDialog(
278277
)}
279278

280279
{selectedTab === "AI Knowledge" && (
281-
<div className={`flex h-[150%] w-[200%] justify-between ${styles.aiKnowledgeTab}`}>
280+
<div className={`flex w-full ${styles.aiKnowledgeTab}`}>
282281
<AIKnowledgeTab
283282
metadata={metadata?.keywords ? Object.fromEntries(
284283
Object.entries(metadata.keywords).map(([key, value]) => [

0 commit comments

Comments
 (0)