-
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(ImageBaseOverlay): fix nested Tappable #7006
fix(ImageBaseOverlay): fix nested Tappable #7006
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 65c988e |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7006 +/- ##
==========================================
+ Coverage 83.91% 83.93% +0.02%
==========================================
Files 357 358 +1
Lines 10785 10814 +29
Branches 3557 3560 +3
==========================================
+ Hits 9050 9077 +27
- Misses 1735 1737 +2
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.
737557d
to
7ac884e
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.
LGTM 👍
packages/vkui/src/components/ImageBase/ImageBaseOverlay/ImageBaseOverlay.test.tsx
Outdated
Show resolved
Hide resolved
packages/vkui/src/components/ImageBase/ImageBaseOverlay/types.ts
Outdated
Show resolved
Hide resolved
packages/vkui/src/components/ImageBase/ImageBaseOverlay/hooks.ts
Outdated
Show resolved
Hide resolved
packages/vkui/src/components/ImageBase/ImageBaseOverlay/ImageBaseOverlay.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Andrey Medvedev <andr.medv.spb@gmail.com>
72d4bcf
to
3e63cb6
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.
💅 🔥 🙏
* fix(ImageBaseOverlay): fix nested Tappable * fix(ImageBaseOverlay): add non interactive wrapper * chore: clean up Co-authored-by: Andrey Medvedev <andr.medv.spb@gmail.com> * chore: fix prettier * fix: review notes * fix merge * fix: remove tests * fix: revert DisableClickableLockStateContext adding --------- Co-authored-by: Andrey Medvedev <andr.medv.spb@gmail.com>
* fix(ImageBaseOverlay): fix nested Tappable * fix(ImageBaseOverlay): add non interactive wrapper * chore: clean up Co-authored-by: Andrey Medvedev <andr.medv.spb@gmail.com> * chore: fix prettier * fix: review notes * fix merge * fix: remove tests * fix: revert DisableClickableLockStateContext adding --------- Co-authored-by: Andrey Medvedev <andr.medv.spb@gmail.com>
) * fix(ImageBaseOverlay): fix nested Tappable (#7006) * fix(ImageBaseOverlay): fix nested Tappable * fix(ImageBaseOverlay): add non interactive wrapper * chore: clean up Co-authored-by: Andrey Medvedev <andr.medv.spb@gmail.com> * chore: fix prettier * fix: review notes * fix merge * fix: remove tests * fix: revert DisableClickableLockStateContext adding --------- Co-authored-by: Andrey Medvedev <andr.medv.spb@gmail.com> * fix: run prettier * CHORE: Update screenshots * fix: delete e2e test --------- Co-authored-by: Andrey Medvedev <andr.medv.spb@gmail.com> Co-authored-by: GitHub Action <actions@github.com>
Описание
by design
вложенныеTappable
ресетятhover
/active
-состояние верхнеуровневогоTappable
, чтобы поддержать следующее поведение (актуально только для 2-х уровневой вложенности, это оке?):2024-06-11.00.58.07.mov
В случае с
ImageBaseOverlay
такое поведение нежелательно.Изменения
ДобавилаDisableClickableLockStateContext
для отключения такого поведения (принимаю в пожертвование лучшее название).Сначала думала сделать это через проп на
Tappable
, но, кажется, что DX такого решения будет сомнительный. Например, в случае сImageBaseOverlay
мы точно знаем, что дефолтное поведение не нужно, но будем заставлять пользователя в каждую кнопку прокидывать проп 🤔Изменения v2
В текущей версии компонента некорректно передавать в
overlay
интерактивные элементы, потому что получается кнопка в кнопке.В новой реализации убрала использование
Tappable
- кажется, это неbreaking change
, потому что мы никакие пропы, специфичные дляTappable
не прокидывали - по сути он нам нужен только дляhover
-эффекта (остальное мы либо отключаем, либо не можем отключить, но оно мешает - например, меняется вид поинтера). В итоге получился интерактивный и неинтерактивный компоненты, принимаем решение, какой из них рисовать, на основе нового пропаdisableInteractive
- в таске предлагали завязываться наonClick
, но такое мы не можем провернуть - потому что сейчас поведение по-умолчанию - если onClick не передан, то мы подставляемnoop
иhover
-эффект работает из коробки (кому-то можем сломать это поведение).