Commit 71c3303
committed
Make inline region dropdown keyboard-operable and harden role parser
region-selector.js: the inline dropdown was mouse-only — every option
had tabIndex=-1 and only a click handler. Add a standard listbox
keyboard contract:
- Tab focuses the trigger; ArrowDown / Enter / Space opens the menu
and focuses the active option (ArrowUp opens at the last option)
- Inside the open menu: ArrowDown/ArrowUp move focus, Home/End jump
to first/last, Enter/Space select, Escape closes and returns
focus to the trigger, Tab closes and lets the browser advance
- Roving tabindex: the focused option holds tabIndex=0, the rest -1,
so the menu participates correctly in the page's tab order
- Selection closes the menu, restores focus to the trigger, and
flows through the existing syncAll() so every other region
selector updates in lock-step
region_box.py: defensive fallback in robusta_url_role so an
empty-after-strip label can never produce an empty anchor — if the
label half ends up blank, fall back to the URL as link text. Today's
regex can't actually emit an empty label, but the guard makes a
future regex tweak safe.1 parent 6168baf commit 71c3303
2 files changed
Lines changed: 80 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
147 | 162 | | |
148 | 163 | | |
149 | 164 | | |
150 | 165 | | |
151 | 166 | | |
152 | | - | |
153 | 167 | | |
154 | 168 | | |
| 169 | + | |
155 | 170 | | |
156 | 171 | | |
157 | 172 | | |
158 | 173 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
163 | 211 | | |
164 | 212 | | |
165 | 213 | | |
166 | 214 | | |
167 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
168 | 224 | | |
169 | 225 | | |
170 | 226 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
175 | 244 | | |
176 | 245 | | |
177 | 246 | | |
| |||
0 commit comments