From 285afa8d73ab2d287a1da638178abff35e37eba1 Mon Sep 17 00:00:00 2001 From: LuseBiswas Date: Fri, 6 Sep 2024 01:07:51 +0530 Subject: [PATCH 1/8] Fixing Broken Scrolling in Full Screen Dilouge Box --- packages/mui-material/src/Dialog/Dialog.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/mui-material/src/Dialog/Dialog.js b/packages/mui-material/src/Dialog/Dialog.js index 0bea089324fe5d..8d7ed2e01b8e58 100644 --- a/packages/mui-material/src/Dialog/Dialog.js +++ b/packages/mui-material/src/Dialog/Dialog.js @@ -118,6 +118,7 @@ const DialogPaper = styled(Paper, { memoTheme(({ theme }) => ({ margin: 32, position: 'relative', + overflow: 'auto', // Ensure scrolling by default '@media print': { overflowY: 'visible', boxShadow: 'none', @@ -192,10 +193,12 @@ const DialogPaper = styled(Paper, { maxWidth: '100%', height: '100%', maxHeight: 'none', + overflow: 'auto', // Fix: Add scrolling for full-screen dialog borderRadius: 0, [`&.${dialogClasses.paperScrollBody}`]: { margin: 0, maxWidth: '100%', + overflow: 'auto', // Fix: Ensure overflow is handled properly }, }, }, From 59545ce4d42e678758c4928974f4bc176d13f179 Mon Sep 17 00:00:00 2001 From: LuseBiswas Date: Fri, 6 Sep 2024 02:21:39 +0530 Subject: [PATCH 2/8] Updating the Fix broken scrolling in full screen --- packages/mui-material/src/Dialog/Dialog.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/mui-material/src/Dialog/Dialog.js b/packages/mui-material/src/Dialog/Dialog.js index 8d7ed2e01b8e58..e4947e90bfe548 100644 --- a/packages/mui-material/src/Dialog/Dialog.js +++ b/packages/mui-material/src/Dialog/Dialog.js @@ -118,7 +118,7 @@ const DialogPaper = styled(Paper, { memoTheme(({ theme }) => ({ margin: 32, position: 'relative', - overflow: 'auto', // Ensure scrolling by default + overflowY: 'auto', '@media print': { overflowY: 'visible', boxShadow: 'none', @@ -193,12 +193,12 @@ const DialogPaper = styled(Paper, { maxWidth: '100%', height: '100%', maxHeight: 'none', - overflow: 'auto', // Fix: Add scrolling for full-screen dialog + borderRadius: 0, [`&.${dialogClasses.paperScrollBody}`]: { margin: 0, maxWidth: '100%', - overflow: 'auto', // Fix: Ensure overflow is handled properly + }, }, }, From ed5a74ae6a145985a38397c6a1aa687df898eca4 Mon Sep 17 00:00:00 2001 From: LuseBiswas Date: Fri, 6 Sep 2024 02:25:31 +0530 Subject: [PATCH 3/8] Removing The Spaces --- packages/mui-material/src/Dialog/Dialog.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/mui-material/src/Dialog/Dialog.js b/packages/mui-material/src/Dialog/Dialog.js index e4947e90bfe548..35911bdb8eae01 100644 --- a/packages/mui-material/src/Dialog/Dialog.js +++ b/packages/mui-material/src/Dialog/Dialog.js @@ -193,12 +193,10 @@ const DialogPaper = styled(Paper, { maxWidth: '100%', height: '100%', maxHeight: 'none', - borderRadius: 0, [`&.${dialogClasses.paperScrollBody}`]: { margin: 0, - maxWidth: '100%', - + maxWidth: '100%', }, }, }, From e807d3fcd2eb4c10bb6f40bc9b67b951c91e9067 Mon Sep 17 00:00:00 2001 From: Diego Andai Date: Thu, 5 Sep 2024 16:56:58 -0400 Subject: [PATCH 4/8] Remove space Signed-off-by: Diego Andai --- packages/mui-material/src/Dialog/Dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mui-material/src/Dialog/Dialog.js b/packages/mui-material/src/Dialog/Dialog.js index 35911bdb8eae01..44fc172481c5cf 100644 --- a/packages/mui-material/src/Dialog/Dialog.js +++ b/packages/mui-material/src/Dialog/Dialog.js @@ -196,7 +196,7 @@ const DialogPaper = styled(Paper, { borderRadius: 0, [`&.${dialogClasses.paperScrollBody}`]: { margin: 0, - maxWidth: '100%', + maxWidth: '100%', }, }, }, From 63cee0599ca6d842267a5bbbe18143fa045d3989 Mon Sep 17 00:00:00 2001 From: LuseBiswas Date: Fri, 6 Sep 2024 11:02:33 +0530 Subject: [PATCH 5/8] Fixing pnpm prettier issue to pass all test case --- packages/mui-material/src/Dialog/Dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mui-material/src/Dialog/Dialog.js b/packages/mui-material/src/Dialog/Dialog.js index 44fc172481c5cf..53a04076dc6adc 100644 --- a/packages/mui-material/src/Dialog/Dialog.js +++ b/packages/mui-material/src/Dialog/Dialog.js @@ -118,7 +118,7 @@ const DialogPaper = styled(Paper, { memoTheme(({ theme }) => ({ margin: 32, position: 'relative', - overflowY: 'auto', + overflowY: 'auto', '@media print': { overflowY: 'visible', boxShadow: 'none', From bee3accf6fc9857462d7dd959bc0e8e791691c90 Mon Sep 17 00:00:00 2001 From: DiegoAndai Date: Fri, 6 Sep 2024 13:51:46 -0400 Subject: [PATCH 6/8] Add test --- .../mui-material/src/Dialog/Dialog.test.js | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/packages/mui-material/src/Dialog/Dialog.test.js b/packages/mui-material/src/Dialog/Dialog.test.js index a0eb5c3d8ee823..a25e0541f6bd8e 100644 --- a/packages/mui-material/src/Dialog/Dialog.test.js +++ b/packages/mui-material/src/Dialog/Dialog.test.js @@ -318,6 +318,39 @@ describe('', () => { ); expect(getByTestId('paper')).not.to.have.class(classes.paperFullScreen); }); + + it('scrolls if overflown on the Y axis', function test() { + if (/jsdom/.test(window.navigator.userAgent)) { + this.skip(); + } + + const ITEM_HEIGHT = 100; + const ITEM_COUNT = 10; + + const { getByTestId } = render( + + {Array.from(Array(ITEM_COUNT).keys()).map((item) => ( +
+ {item} +
+ ))} +
, + ); + const paperElement = getByTestId('paper'); + expect(paperElement.scrollTop).to.equal(0); + expect(paperElement.clientHeight).to.equal(ITEM_HEIGHT); + expect(paperElement.scrollHeight).to.equal(ITEM_HEIGHT * ITEM_COUNT); + fireEvent.scroll(getByTestId('paper'), { target: { scrollTop: ITEM_HEIGHT } }); + expect(paperElement.scrollTop).to.equal(ITEM_HEIGHT); + }); }); describe('prop: PaperProps.className', () => { From 566ef00edee8ca84675e7facb5df21fe9d5d106c Mon Sep 17 00:00:00 2001 From: ZeeshanTamboli Date: Sat, 7 Sep 2024 12:44:42 +0530 Subject: [PATCH 7/8] refactor test --- packages/mui-material/src/Dialog/Dialog.test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/mui-material/src/Dialog/Dialog.test.js b/packages/mui-material/src/Dialog/Dialog.test.js index a25e0541f6bd8e..8dd59e51b3c425 100644 --- a/packages/mui-material/src/Dialog/Dialog.test.js +++ b/packages/mui-material/src/Dialog/Dialog.test.js @@ -337,7 +337,6 @@ describe('', () => {
{item}
@@ -348,7 +347,7 @@ describe('', () => { expect(paperElement.scrollTop).to.equal(0); expect(paperElement.clientHeight).to.equal(ITEM_HEIGHT); expect(paperElement.scrollHeight).to.equal(ITEM_HEIGHT * ITEM_COUNT); - fireEvent.scroll(getByTestId('paper'), { target: { scrollTop: ITEM_HEIGHT } }); + fireEvent.scroll(paperElement, { target: { scrollTop: ITEM_HEIGHT } }); expect(paperElement.scrollTop).to.equal(ITEM_HEIGHT); }); }); From af7e0e662f6a9c257e2f1e6abc9733d2db7a07c3 Mon Sep 17 00:00:00 2001 From: ZeeshanTamboli Date: Sat, 7 Sep 2024 13:02:49 +0530 Subject: [PATCH 8/8] prettier --- packages/mui-material/src/Dialog/Dialog.test.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/mui-material/src/Dialog/Dialog.test.js b/packages/mui-material/src/Dialog/Dialog.test.js index 8dd59e51b3c425..dd954f5b4f0b27 100644 --- a/packages/mui-material/src/Dialog/Dialog.test.js +++ b/packages/mui-material/src/Dialog/Dialog.test.js @@ -334,10 +334,7 @@ describe('', () => { PaperProps={{ 'data-testid': 'paper', sx: { height: ITEM_HEIGHT } }} > {Array.from(Array(ITEM_COUNT).keys()).map((item) => ( -
+
{item}
))}