Commit 056aaf3
authored
feat: Add more ephemeral overrides for drop-downs. (#9086)
## The basics
- [x] I [validated my changes](https://developers.google.com/blockly/guides/contribute/core#making_and_verifying_a_change)
## The details
### Resolves
Fixes #9078
Fixes part of #8915 (new tests)
### Proposed Changes
Exposes the ability to disable ephemeral focus management for drop-down divs that are shown using `showPositionedByBlock` or `showPositionedByField`. Previously, this was only supported via `show`, but the former methods are also used externally.
This allows the underlying issue reported by #9078 to be fixed downstream for cases when both the widget and drop-down divs are opened simultaneously.
This PR also introduces tab indexes for both widget and drop-down divs (which were noticed missing when adding tests). This is because, currently, taking ephemeral focus on for a node that doesn't have a tab index will do nothing. This fix is useful for future screen reader work, and doesn't have obvious impacts on existing core or keyboard navigation behaviors (per testing and reasoning).
### Reason for Changes
Exposing the ability to disable ephemeral focus management for all public API entrypoints for showing the divs is crucial for providing the maximum flexibility when downstream apps use both the widget and drop-down divs together. This should ensure that all of these cases can be correctly managed in the same way as RaspberryPiFoundation/blockly-samples#2521.
### Test Coverage
This introduces a bunch of new tests that were missing originally for both widget and drop-down div (including specifically verifying ephemeral focus). As part of the drop-down div tests, it also introduces actual positioning logic. This isn't great, but it's somewhat reasonable and robust against page changes (since the actual mocha results can move where the elements will end up on the page).
These changes have also been manually tested with both the core simple playground and the keyboard experiment plugin's test environment with no noticed regressions in either. The plugin's tests have also been run against these changes to ensure no new breakages have been introduced.
### Documentation
No documentation changes beyond the code ones introduced in this PR should be needed.
### Additional Information
The new tests may actually act as a basis for avoiding the test backdoor that's used today for the positioning tests for drop-down div tests. This doesn't replace those existing tests nor does it cover other behaviors and entrypoints that would be worth testing, but testing ephemeral focus is a nice improvement (especially in the context of what this PR is fixing).1 parent 4f3eade commit 056aaf3
File tree
4 files changed
+472
-12
lines changed- core
- tests/mocha
4 files changed
+472
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| |||
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
195 | 201 | | |
196 | 202 | | |
197 | 203 | | |
198 | 204 | | |
199 | 205 | | |
200 | 206 | | |
201 | 207 | | |
| 208 | + | |
202 | 209 | | |
203 | 210 | | |
204 | 211 | | |
205 | 212 | | |
| 213 | + | |
206 | 214 | | |
207 | 215 | | |
208 | 216 | | |
| |||
217 | 225 | | |
218 | 226 | | |
219 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
220 | 233 | | |
221 | 234 | | |
222 | 235 | | |
223 | 236 | | |
224 | 237 | | |
225 | 238 | | |
| 239 | + | |
226 | 240 | | |
227 | 241 | | |
228 | 242 | | |
229 | 243 | | |
230 | 244 | | |
| 245 | + | |
231 | 246 | | |
232 | 247 | | |
233 | 248 | | |
| |||
271 | 286 | | |
272 | 287 | | |
273 | 288 | | |
274 | | - | |
275 | | - | |
| 289 | + | |
276 | 290 | | |
277 | 291 | | |
278 | 292 | | |
279 | 293 | | |
280 | 294 | | |
| 295 | + | |
281 | 296 | | |
282 | 297 | | |
283 | | - | |
284 | 298 | | |
285 | 299 | | |
286 | 300 | | |
| |||
352 | 366 | | |
353 | 367 | | |
354 | 368 | | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | 369 | | |
360 | 370 | | |
361 | 371 | | |
| |||
364 | 374 | | |
365 | 375 | | |
366 | 376 | | |
367 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
368 | 386 | | |
369 | 387 | | |
370 | 388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
0 commit comments