Skip to content

Commit 93d1cea

Browse files
tellthemachinesandrewserongmirkatalldanntsekouras
authored
Try fixing full-screen modal height so contents can scroll (#73150)
Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: Mayank-Tripathi32 <mayanktripathi32@git.wordpress.org>
1 parent 5149e52 commit 93d1cea

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

packages/components/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
- `Card`, `CardHeader`, `CardBody` and `CardFooter`: Add support for directional padding through object-based size prop, allowing independent control of padding for each side ([#72511](https://github.com/WordPress/gutenberg/pull/72511)).
1717
- `CustomSelectControl`: Fix the options with the same name are shown as the selected option ([#72189](https://github.com/WordPress/gutenberg/pull/72189)).
1818
- `NumberControl`: Fix crash when min prop is string and step prop contains decimal ([#73107](https://github.com/WordPress/gutenberg/pull/73107)).
19+
- `Modal`: Fix full-screen modal height to allow contents to scroll properly ([#73150](https://github.com/WordPress/gutenberg/pull/73150)).
20+
1921

2022
### Internal
2123

packages/components/src/modal/style.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@
106106
@include break-large() {
107107
max-height: 70%;
108108
}
109+
110+
&.is-full-screen {
111+
// When full screen, make sure the children container is full height.
112+
.components-modal__content {
113+
display: flex;
114+
// If this container is scrollable, bottom padding won't apply so we use margin instead.
115+
margin-bottom: $grid-unit-40;
116+
padding-bottom: 0;
117+
118+
> :last-child {
119+
flex: 1;
120+
}
121+
}
122+
}
109123
}
110124

111125
@keyframes components-modal__appear-animation {

packages/dataviews/src/stories/dataviews-picker.story.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -271,18 +271,16 @@ export const WithModal = ( {
271271
isFullScreen={ false }
272272
size="fill"
273273
>
274-
<div style={ { padding: '16px' } }>
275-
<DataViewsPickerContent
276-
perPageSizes={ perPageSizes }
277-
isMultiselectable={ isMultiselectable }
278-
isGrouped={ isGrouped }
279-
infiniteScrollEnabled={ infiniteScrollEnabled }
280-
actions={ modalActions }
281-
selection={ selectedItems.map( ( item ) =>
282-
String( item.id )
283-
) }
284-
/>
285-
</div>
274+
<DataViewsPickerContent
275+
perPageSizes={ perPageSizes }
276+
isMultiselectable={ isMultiselectable }
277+
isGrouped={ isGrouped }
278+
infiniteScrollEnabled={ infiniteScrollEnabled }
279+
actions={ modalActions }
280+
selection={ selectedItems.map( ( item ) =>
281+
String( item.id )
282+
) }
283+
/>
286284
</Modal>
287285
) }
288286
</>

0 commit comments

Comments
 (0)