Commit d778ed2
authored
[web] Detect scrollable semantics nodes more reliably (#164491)
When a text field is inside a scrollable, and the virtual keyboard shows
up, it (sometimes) makes the scrollable semantics node have a 0 extent.
In that case, the scrollable node has no scroll actions attached. In the
web engine, we detect that as a change of roles (from scrollable to
generic) which causes a DOM mutation above the text field, so the
browser shifts focus to the `<body>`.
In order to avoid this bug, this PR changes how we detect a scrollable
node by checking for the
[`hasImplicitScrolling`](https://api.flutter.dev/flutter/dart-ui/SemanticsFlag/hasImplicitScrolling-constant.html)
flag.
Fixes flutter/flutter#1547411 parent 099e6d3 commit d778ed2
File tree
4 files changed
+45
-10
lines changed- engine/src/flutter/lib
- ui
- web_ui
- lib/src/engine/semantics
- test/engine/semantics
4 files changed
+45
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1054 | 1054 | | |
1055 | 1055 | | |
1056 | 1056 | | |
1057 | | - | |
| 1057 | + | |
1058 | 1058 | | |
1059 | 1059 | | |
1060 | 1060 | | |
| |||
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
236 | 238 | | |
237 | | - | |
238 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
239 | 242 | | |
| 243 | + | |
| 244 | + | |
240 | 245 | | |
241 | 246 | | |
242 | 247 | | |
243 | 248 | | |
244 | 249 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1365 | 1365 | | |
1366 | 1366 | | |
1367 | 1367 | | |
1368 | | - | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
1369 | 1373 | | |
1370 | 1374 | | |
1371 | 1375 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1321 | 1321 | | |
1322 | 1322 | | |
1323 | 1323 | | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
1324 | 1348 | | |
1325 | 1349 | | |
1326 | 1350 | | |
| |||
1329 | 1353 | | |
1330 | 1354 | | |
1331 | 1355 | | |
| 1356 | + | |
1332 | 1357 | | |
1333 | 1358 | | |
1334 | 1359 | | |
| |||
1353 | 1378 | | |
1354 | 1379 | | |
1355 | 1380 | | |
| 1381 | + | |
1356 | 1382 | | |
1357 | 1383 | | |
1358 | 1384 | | |
| |||
1405 | 1431 | | |
1406 | 1432 | | |
1407 | 1433 | | |
| 1434 | + | |
1408 | 1435 | | |
1409 | 1436 | | |
1410 | 1437 | | |
| |||
1485 | 1512 | | |
1486 | 1513 | | |
1487 | 1514 | | |
| 1515 | + | |
1488 | 1516 | | |
1489 | 1517 | | |
1490 | 1518 | | |
| |||
1554 | 1582 | | |
1555 | 1583 | | |
1556 | 1584 | | |
| 1585 | + | |
1557 | 1586 | | |
1558 | 1587 | | |
1559 | 1588 | | |
| |||
1576 | 1605 | | |
1577 | 1606 | | |
1578 | 1607 | | |
| 1608 | + | |
1579 | 1609 | | |
1580 | 1610 | | |
1581 | 1611 | | |
| |||
1628 | 1658 | | |
1629 | 1659 | | |
1630 | 1660 | | |
| 1661 | + | |
1631 | 1662 | | |
1632 | 1663 | | |
1633 | 1664 | | |
| |||
0 commit comments