Commit ee39c5f
committed
fix: make TabButton close button aria compliant as a button
Make the close button on TabButton a button instead of a div. It looks identical
and is aria compliant as a button, supporting screen readers and keyboard
navigation with tab to select and enter or space to click. Note that a event
handler for onCloseKeyDown was added to stop event propagation when pressing
enter or space, so that the button's normal onClick logic is called, and the
keyboard event does not propagate to the TabButton keyboard event handler.
Allows using the keyboard to select the tab close button by pressing the Tab key
to switch between elements on the page, and then pressing "enter" or space " "
to select the highlighted button.
Signed-off-by: Christian Stewart <[email protected]>1 parent 6a5a28d commit ee39c5f
1 file changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
| |||
161 | 166 | | |
162 | 167 | | |
163 | 168 | | |
164 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
165 | 178 | | |
166 | | - | |
| 179 | + | |
167 | 180 | | |
168 | 181 | | |
169 | 182 | | |
| |||
0 commit comments