-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(CustomScrollView): add resize container handler #7060
fix(CustomScrollView): add resize container handler #7060
Conversation
Передалал реализацию useResizeObserver и использование его в CustomScrollView
size-limit report 📦
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
e2e tests |
👀 Docs deployed
Commit 4a7abce |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7060 +/- ##
==========================================
+ Coverage 83.49% 83.54% +0.05%
==========================================
Files 351 352 +1
Lines 10501 10528 +27
Branches 3477 3486 +9
==========================================
+ Hits 8768 8796 +28
+ Misses 1733 1732 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Классный хук! 👍
Лишь один комментарий.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отлично 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
packages/vkui/src/components/CustomScrollView/CustomScrollView.module.css
Show resolved
Hide resolved
Co-authored-by: Inomdzhon Mirdzhamolov <i.mirdzhamolov@vk.team>
1. Добавил хук useResizeObserver, внутри которого используется CustomResizeObserver 2. Переиспользовал хук useResizeObserver в CustomScrollView для отслеживания изменений размеров
@@ -15,6 +15,10 @@ | |||
position: relative; | |||
} | |||
|
|||
.CustomScrollView__box-content { | |||
position: relative; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EldarMuhamethanov а добавьте
inline-size: 100%;
block-size: 100%;
как у родителей, а то "растянутость" на контейнер теряется.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Semigradsky задумка была, такая что этот элемент, растягивается на реальные размеры контента, а не на размеры родителя. Мне кажется так сломается изначальный кейс. Можешь рассказать какой кейс сейчас ломается? если такой есть
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Например, растягиваем контейнер на всю страницу, у содержимого min-height: 100%
. До этих исправлений отображался кастомный скролл, если содержимое занимает бОльшее пространство.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#7097 - PR с правкой
Описание