Skip to content

Commit

Permalink
fix(ModalPage): apply user height for desktop (#8036)
Browse files Browse the repository at this point in the history
h2. Описание

Для **desktop** было зашито `block-size: auto`. Поменял на использование `--vkui_internal_ModalPage--userHeight`, который по умолчанию `auto` для **desktop**.

h2. Release notes
h2. Исправления
- ModalPage: не применялся `height` на **desktop** экране
  • Loading branch information
inomdzhon authored and actions-user committed Dec 4, 2024
1 parent 12abe6d commit 3c1a122
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions packages/vkui/src/components/ModalPage/ModalPage.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
.host {
--vkui_internal_ModalPage--userHeight: 100%;
--vkui_internal_ModalPage--desktopMaxWidth: 100%;

display: flex;
inline-size: 100%;
block-size: var(--vkui_internal_ModalPage--userHeight);
Expand All @@ -13,6 +10,8 @@
/* Mobile */
@media (--viewWidth-smallTabletMinus) {
.host {
--vkui_internal_ModalPage--userHeight: 100%;

position: absolute;
inset-inline: 0;
inset-block-end: 0;
Expand All @@ -33,11 +32,13 @@
/* Desktop */
@media (--viewWidth-smallTabletPlus) {
.host {
--vkui_internal_ModalPage--desktopMaxWidth: 100%;
--vkui_internal_ModalPage--userHeight: auto;

position: relative;
margin-block: auto;
max-inline-size: var(--vkui_internal_ModalPage--desktopMaxWidth);
max-block-size: calc(100% - 64px); /* FIXME 64px??? */
block-size: auto;
}

.hostMaxWidthS {
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/ModalRoot/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const App = () => {
id={MODAL_PAGE_WITH_FIXED_HEIGHT}
onClose={modalBack}
settlingHeight={100}
height={isDesktop ? 250 : '70%'}
height={isDesktop ? '250px' : '70%'}
hideCloseButton={platform === 'ios'}
header={
<ModalPageHeader
Expand Down

0 comments on commit 3c1a122

Please sign in to comment.