Skip to content
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

Merged
merged 9 commits into from
Jun 24, 2024

Conversation

EldarMuhamethanov
Copy link
Contributor


  • Unit-тесты

Описание

  1. Добавил хук useResizeObserver, внутри которого используется CustomResizeObserver
  2. Переиспользовал хук useResizeObserver в CustomScrollView для отслеживания изменений размеров

@EldarMuhamethanov EldarMuhamethanov requested a review from a team as a code owner June 24, 2024 07:54
@github-actions github-actions bot added the patch Автоматизация: PR продублируется в ветку последнего минорного релиза для выпуска патча label Jun 24, 2024
Copy link
Contributor

github-actions bot commented Jun 24, 2024

size-limit report 📦

Path Size
JS 364.16 KB (+0.08% 🔺)
JS (gzip) 111.43 KB (+0.1% 🔺)
JS (brotli) 91.71 KB (+0.09% 🔺)
JS import Div (tree shaking) 1.42 KB (0%)
CSS 285.14 KB (+0.02% 🔺)
CSS (gzip) 36.99 KB (+0.03% 🔺)
CSS (brotli) 29.94 KB (+0.09% 🔺)

Copy link

codesandbox-ci bot commented Jun 24, 2024

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.

Copy link
Contributor

github-actions bot commented Jun 24, 2024

e2e tests

Playwright Report

Copy link
Contributor

github-actions bot commented Jun 24, 2024

👀 Docs deployed

Commit 4a7abce

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.54%. Comparing base (0f7194b) to head (4a7abce).
Report is 12 commits behind head on master.

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     
Flag Coverage Δ
unittests 83.54% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mendrew mendrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Классный хук! 👍

Лишь один комментарий.

packages/vkui/src/hooks/useResizeObserver.ts Outdated Show resolved Hide resolved
mendrew
mendrew previously approved these changes Jun 24, 2024
Copy link
Contributor

@mendrew mendrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отлично 💯

Copy link
Contributor

@inomdzhon inomdzhon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Co-authored-by: Inomdzhon Mirdzhamolov <i.mirdzhamolov@vk.team>
@inomdzhon inomdzhon merged commit f16f3b7 into master Jun 24, 2024
26 checks passed
@inomdzhon inomdzhon deleted the e.muhamethanov/7043/custom-scroll-view-resize branch June 24, 2024 14:41
vkcom-publisher pushed a commit that referenced this pull request Jun 24, 2024
1. Добавил хук useResizeObserver, внутри которого используется CustomResizeObserver
2. Переиспользовал хук useResizeObserver в CustomScrollView для отслеживания изменений размеров
@@ -15,6 +15,10 @@
position: relative;
}

.CustomScrollView__box-content {
position: relative;
Copy link
Contributor

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%;

как у родителей, а то "растянутость" на контейнер теряется.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Semigradsky задумка была, такая что этот элемент, растягивается на реальные размеры контента, а не на размеры родителя. Мне кажется так сломается изначальный кейс. Можешь рассказать какой кейс сейчас ломается? если такой есть

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Например, растягиваем контейнер на всю страницу, у содержимого min-height: 100%. До этих исправлений отображался кастомный скролл, если содержимое занимает бОльшее пространство.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#7097 - PR с правкой

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Автоматизация: PR продублируется в ветку последнего минорного релиза для выпуска патча
Projects
None yet
4 participants