Commit 29b5a0d
authored
fix: Fix ephemeral focus being taken twice (#2521)
## The basics
- [x] I [validated my changes](https://developers.google.com/blockly/guides/contribute/samples#making_and_verifying_a_change)
## The details
### Resolves
Fixes #2514
Fixes #2515
### Proposed Changes
This updates the custom field implementations for `field-sldier` and `field-angle` to use new functionality introduced in RaspberryPiFoundation/blockly#9051.
### Reason for Changes
The regressions reported in #2514 and #2515 were introduced due to the custom fields introducing a scenario where _both_ widget and drop-down divs attempted to take ephemeral focus. This isn't allowed currently as core's `FocusManager` has no tie breaking functionality for ephemeral focus, so the second attempt to request it throws a runtime failure.
The functionality introduced in RaspberryPiFoundation/blockly#9051 allows the custom fields to, through `FieldInput`, disable the automatic ephemeral focus management for `FieldInput`'s inline editor (which uses widget div) so that the custom fields' drop-down div editors can properly take focus, instead.
### Test Coverage
This has been manually tested locally.
Automated tests are, unfortunately, non-trivial here since verifying focus-related behavior (at least through user interactions) requires a working DOM and is very tricky to make work with Node.js. These are tests that would likely be better suited via webdriver, instead. #2527 has been filed to track this work.
### Documentation
No additional documentation is needed here.
### Additional Information
This requires RaspberryPiFoundation/blockly#9051 in order to work.1 parent f704ca0 commit 29b5a0d
2 files changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
213 | | - | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| |||
0 commit comments