Skip to content

Commit

Permalink
Merge pull request #2472 from VKCOM/2422-fixedlayout-fix-centering
Browse files Browse the repository at this point in the history
fix(FixedLayout): revert to 1364 PR number
  • Loading branch information
inomdzhon authored May 13, 2022
2 parents 68f4db2 + 6ef1bab commit 46712a0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/FixedLayout/FixedLayout.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
.FixedLayout {
position: fixed;
box-sizing: border-box;
/**
* ⚠️ WARNING ⚠️
* `left: auto` решает следующие задачи:
* 1. При фиксированной ширине компонента позиционирует компонент по центру.
* 2. При использовании `SplitLayout` позиционирует компонент с права от `<SplitCol fixed />`.
*
* Подробности можно почитать здесь https://github.com/VKCOM/VKUI/pull/2472
*
* Единственное, есть проблема при срабатывании insets в landscape ориентации экрана (https://github.com/VKCOM/VKUI/issues/2422).
*/
left: auto;
z-index: 3;
padding-left: var(--safe-area-inset-left);
Expand All @@ -14,12 +24,10 @@
.FixedLayout--top {
width: 100%;
top: 0;
left: 0;
}

.FixedLayout--bottom {
width: 100%;
left: 0;
bottom: 0;
padding-bottom: var(--safe-area-inset-bottom);
}
Expand Down

0 comments on commit 46712a0

Please sign in to comment.