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(Link): Remove ripple part of Link by disabling Tappable hoverMode #7088

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

mendrew
Copy link
Contributor

@mendrew mendrew commented Jun 27, 2024


Описание

Из-за того, что у компонентов Link всегда рендерится часть Tappable для ripple-эффекта, спозиционированная абсолютно, Link не прячется в Safari вместе с контентом если контент переполнил родительский элемент.

Это, конечно, странное поведение Safari, но и у нас довольно странно в DOM вставлять Ripple компонент, который для Link совсем не нужен.

Изменения

Руководствуясь условием в Tappable, по которому мы рендерим Ripple компонент

{isClickable && (hoverMode === 'background' || activeMode === 'background') && (
<Ripple needRipple={needRipple} clicks={clicks} />
)}

мы убираем hoverMode="none" у Link.

Это безопасно, потому что hoverMode="background" у Tappable есть по умолчанию и управляет он фоном, которого у Link нету. Так что на Link это никак не повлияет.

.Tappable--hovered-background > .Tappable__stateLayer {
background-color: var(--vkui--color_transparent--hover);
}

Изображения

Screenshot 2024-06-27 at 10 36 03

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

size-limit report 📦

Path Size
JS 365.03 KB (+0.01% 🔺)
JS (gzip) 111.77 KB (+0.01% 🔺)
JS (brotli) 91.95 KB (-0.19% 🔽)
JS import Div (tree shaking) 1.42 KB (0%)
CSS 286.55 KB (0%)
CSS (gzip) 37.18 KB (0%)
CSS (brotli) 30.05 KB (0%)

Copy link

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

e2e tests

Playwright Report

Copy link
Contributor

👀 Docs deployed

Commit 92d8c08

Copy link

codecov bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.67%. Comparing base (606ec64) to head (92d8c08).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7088   +/-   ##
=======================================
  Coverage   83.67%   83.67%           
=======================================
  Files         353      353           
  Lines       10565    10565           
  Branches     3499     3499           
=======================================
  Hits         8840     8840           
  Misses       1725     1725           
Flag Coverage Δ
unittests 83.67% <ø> (ø)

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

@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.

👏

@mendrew mendrew removed the patch Автоматизация: PR продублируется в ветку последнего минорного релиза для выпуска патча label Jun 27, 2024
@mendrew mendrew merged commit b954643 into master Jun 27, 2024
26 checks passed
@mendrew mendrew deleted the mendrew/Link/fix/avoid-ripple-element branch June 27, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants