mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-29 08:17:47 +00:00
Enhance accessibility of dropdown (#30928)
* fix: enhance accessibility of dropdown component by adding tabIndex and improving keyboard navigation * test: update snapshot * feat: use tabindex -1 * test: add tests
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`<Dropdown /> renders with placeholder 1`] = `
|
||||
<DocumentFragment>
|
||||
<div
|
||||
class="mx_Dropdown"
|
||||
>
|
||||
<div
|
||||
aria-describedby="id_value"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="listbox"
|
||||
aria-label="Test Dropdown"
|
||||
aria-owns="id_input"
|
||||
class="mx_AccessibleButton mx_Dropdown_input mx_no_textinput"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="mx_Dropdown_option"
|
||||
id="id_value"
|
||||
>
|
||||
Select an option
|
||||
</div>
|
||||
<span
|
||||
class="mx_Dropdown_arrow"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</DocumentFragment>
|
||||
`;
|
||||
@@ -11,6 +11,7 @@ exports[`<FilterDropdown /> renders dropdown options in menu 1`] = `
|
||||
class="mx_Dropdown_option mx_Dropdown_option_highlight"
|
||||
id="test__one"
|
||||
role="option"
|
||||
tabindex="-1"
|
||||
>
|
||||
<div
|
||||
class="mx_FilterDropdown_option"
|
||||
@@ -40,6 +41,7 @@ exports[`<FilterDropdown /> renders dropdown options in menu 1`] = `
|
||||
class="mx_Dropdown_option"
|
||||
id="test__two"
|
||||
role="option"
|
||||
tabindex="-1"
|
||||
>
|
||||
<div
|
||||
class="mx_FilterDropdown_option"
|
||||
|
||||
Reference in New Issue
Block a user