-
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
feat: reexport useScroll as useRootScrollController #7813
Conversation
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 13f0795 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7813 +/- ##
==========================================
+ Coverage 95.08% 95.11% +0.03%
==========================================
Files 376 376
Lines 11074 11081 +7
Branches 3677 3683 +6
==========================================
+ Hits 10530 10540 +10
+ Misses 544 541 -3
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.
В Release Notes написано про useRootScrollController
, а в коде это useAppScrollController
Может ещё тогда немножко доки через jsdoc добавим, чтобы Release notes не был единственным источником информации о том за какой скролл отвечют хуки и где это полезно?
ой, это изменение не допушилось... сейчас запушу, спасибо, что заметил |
13f0795
ea11cfa
to
13f0795
Compare
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.
Давай отдавать только useScrollLock, остальное не нужно
см. #7813 (comment) |
Описание
Есть случаи, когда тип экспортируют через
@vkontakte/vkui/dist/components/AppRoot/ScrollContext
. В целом полезно иметь доступ к интерфейсуScrollController
.Также экспортируем тип
ScrollContextInterface
какUseRootScrollController
.Изменения
Release notes
Улучшения
useRootScrollController()
– хук предоставляет API для блокировки и разблокировки скролла основного элемента, который определяется параметромscroll
вAppRoot
. Используется при открытии модальных окон, чтобы исправить проблемы с двойным скроллом на мобильных устройствах.