Repository navigation
Commit 8a7fc8e
committed
Keep a control clickable when it contains something
Making containers click-through stopped them swallowing clicks aimed at
the leaves inside them, but it treated every parent as scenery. A control
that happens to contain something else is still a control: the cart
button became unclickable the moment it grew a badge, because the badge
and the icon are nodes of their own. An agent driving the app could only
reach it through the child image — the button itself was no longer among
the things a snapshot offers as actionable.
Only tappable roles are exempted. A role-bearing container such as a list
or a navigation bar spans its children by definition and would go
straight back to swallowing their clicks, so those stay click-through. A
control's own children remain clickable and, sitting on top, still win a
hit test aimed at them.
The roles that must not be exempted are asserted alongside the ones that
must, because the failure of adding one is silent: clicks land on the
wrong element rather than failing.1 parent 1fd3152 commit 8a7fc8e
2 files changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
41 | 58 | | |
42 | 59 | | |
43 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
0 commit comments