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

feat(FocusTrap): add autoFocus to root possibility #7302

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

EldarMuhamethanov
Copy link
Contributor


  • Unit-тесты

Описание

Нужно добавить возможность фокуса на контейнер FocusTrap при первой отрисовке

Изменения

Добавил в пропс autoFocus значение 'root' и использовал его при первой отрисовке, чтобы сфокусироваться на контейнере. Добавил тест проверяющий новый функционал

@EldarMuhamethanov EldarMuhamethanov requested a review from a team as a code owner August 5, 2024 11:40
Copy link
Contributor

github-actions bot commented Aug 5, 2024

size-limit report 📦

Path Size
JS 380.75 KB (+0.02% 🔺)
JS (gzip) 116.09 KB (+0.02% 🔺)
JS (brotli) 95.48 KB (-0.03% 🔽)
JS import Div (tree shaking) 1.39 KB (0%)
CSS 305.95 KB (0%)
CSS (gzip) 39.26 KB (0%)
CSS (brotli) 31.52 KB (0%)

Copy link

codesandbox-ci bot commented Aug 5, 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 Aug 5, 2024

e2e tests

Playwright Report

Copy link
Contributor

github-actions bot commented Aug 5, 2024

👀 Docs deployed

Commit fe87650

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.45%. Comparing base (2b6aded) to head (fe87650).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7302      +/-   ##
==========================================
- Coverage   83.47%   83.45%   -0.02%     
==========================================
  Files         370      369       -1     
  Lines       11181    11178       -3     
  Branches     3658     3659       +1     
==========================================
- Hits         9333     9329       -4     
- Misses       1848     1849       +1     
Flag Coverage Δ
unittests 83.45% <100.00%> (-0.02%) ⬇️

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/components/FocusTrap/FocusTrap.tsx Outdated Show resolved Hide resolved
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.

👏

@inomdzhon inomdzhon merged commit 56ffd0f into master Aug 9, 2024
26 checks passed
@inomdzhon inomdzhon deleted the e.muhamethanov/7268/improve-auto-focus-prop branch August 9, 2024 14:58
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