Skip to content

Commit 2aafa78

Browse files
authored
fix(sheet): z-index and scroll dividers in desktop (#1381)
1 parent 7c465e9 commit 2aafa78

7 files changed

Lines changed: 22 additions & 11 deletions
23.6 KB
Loading
46.7 KB
Loading
2 Bytes
Loading
-50 Bytes
Loading
-109 Bytes
Loading

src/__screenshot_tests__/sheet-screenshot-test.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@ test.each(TESTABLE_DEVICES)('InfoSheet with dismiss button in %s', async (device
104104
expect(image).toMatchImageSnapshot();
105105
});
106106

107+
test.each(TESTABLE_DEVICES)('InfoSheet after scrolling in %s', async (device) => {
108+
const page = await openStoryPage({
109+
id: 'private-sheet-presets--info',
110+
device,
111+
args: {buttonText: 'Dismiss', numItems: 10},
112+
});
113+
114+
const button = await screen.findByRole('button', {name: 'Open'});
115+
await button.click();
116+
117+
await screen.findByRole('dialog');
118+
const listItems = await screen.findAllByRole('listitem');
119+
await listItems[2].evaluate((el) => el.scrollIntoView());
120+
121+
const image = await page.screenshot();
122+
123+
expect(image).toMatchImageSnapshot();
124+
});
125+
107126
test.each(TESTABLE_DEVICES_WITH_LARGE_DESKTOP)('ActionsSheet in %s', async (device) => {
108127
const page = await openStoryPage({
109128
id: 'private-sheet-presets--actions',

src/sheet-common.css.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ export const modalCloseButton = style([
196196
padding: 24,
197197
}),
198198
{
199+
zIndex: 1,
199200
'@media': {
200201
[mq.tabletOrSmaller]: {
201202
display: 'none',
@@ -268,11 +269,7 @@ export const stickyTitle = style([
268269
background: skinVars.colors.background,
269270
}),
270271
{
271-
'@media': {
272-
[mq.tabletOrSmaller]: {
273-
zIndex: 1,
274-
},
275-
},
272+
zIndex: 1,
276273
},
277274
]);
278275

@@ -283,11 +280,7 @@ export const stickyButtons = style([
283280
background: skinVars.colors.background,
284281
}),
285282
{
286-
'@media': {
287-
[mq.tabletOrSmaller]: {
288-
zIndex: 1,
289-
},
290-
},
283+
zIndex: 1,
291284
},
292285
]);
293286

@@ -296,7 +289,6 @@ export const bodyContent = style({
296289
zIndex: 0,
297290
'@media': {
298291
[mq.desktopOrBigger]: {
299-
overflowY: 'auto',
300292
flex: 1,
301293
},
302294
},

0 commit comments

Comments
 (0)