-
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(DateInput): fix DateInput and DateRangeInput a11y #7953
fix(DateInput): fix DateInput and DateRangeInput a11y #7953
Conversation
size-limit report 📦
|
e2e tests
|
👀 Docs deployed
Commit 7ddf7db |
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.
@EldarMuhamethanov здорово! 👏
а ты случайно не слушал как это звучит в NVDA?
Я сам, прости, ещё не проверял, но попробую как-нибудь.
Просто есть опасение, что теперь тут может быть некоторая какафония из-за подписей для каждого элемента маски + input.
Я могу ошибаться, конечно, но это возможно, и если это так, то придётся тогда совсем спрятать от скринридеров маску 🤔
Не слушал, попробую послушать тогда, раз там может быть проблема |
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. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7953 +/- ##
=======================================
Coverage 95.51% 95.51%
=======================================
Files 396 396
Lines 11233 11234 +1
Branches 3718 3718
=======================================
+ Hits 10729 10730 +1
Misses 504 504
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
# Conflicts: # packages/vkui/src/components/DateInput/DateInput.tsx
@andrey-medvedev-vk Наконец-то дошли руки до NVDA. Попробовал, ничего плохого не заметил |
Описание
При использовании компонента
DateInput
внутриFormItem
возникает проблема с некорректной связью междуlabel
и полем ввода через атрибутыfor/id
. Это происходит по двум причинам:FormItem
, привязывается к неинтерактивному элементуspan
внутриFormField
, вместо фактического поля ввода вDateInput
DateInput
скрыто с помощьюtype="hidden"
, что является некорректным подходом с точки зрения доступностиИзменения
Заменили
input type="hidden"
на компонентVisuallyHidden
в:DateInput
DateRangeInput
Реализовали корректную передачу
id
в скрытое поле ввода черезVisuallyHidden
Результат
Теперь
label
изFormItem
корректно связывается с полем ввода через атрибутыfor/id
, что улучшает доступность компонента для пользователей, использующих вспомогательные технологии.Release notes
Исправления
label
черезid
label
черезid