Commit 99119a2
Fix TextLayoutManager MeasureMode Regression (#51183)
Summary:
Pull Request resolved: #51183
D58818560 tried to deduplicate some code, but introduced an error, where we no longer correctly incorporate the width MeasureMode into the text layout that we create, instead, passing `YogaMeasureMode.EXACTLY`.
In effect, this means the Android layout created always takes up the maximum allowable space, even if content is smaller. This is later masked, because our returned measure when `AT_MOST` is based on maximum line length, and the layout is then recreated when drawing a TextView, but means:
1. Attachments may not be positioned correctly, when using a non-left-aligned paragraph alignment
2. Directly drawing the layout shows the wrong thing
Changelog:
[Android][Fixed] - Fix TextLayoutManager MeasureMode Regression
Reviewed By: rshest
Differential Revision: D74366936
fbshipit-source-id: 3eda8c716ba9790a61c2da19023e140afbb6971d1 parent 1c52eec commit 99119a2
4 files changed
Lines changed: 28 additions & 11 deletions
File tree
- packages/react-native
- ReactAndroid
- api
- src/main/java/com/facebook/react
- fabric
- views/text
- ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2357 | 2357 | | |
2358 | 2358 | | |
2359 | 2359 | | |
2360 | | - | |
2361 | 2360 | | |
2362 | 2361 | | |
2363 | 2362 | | |
2364 | 2363 | | |
2365 | 2364 | | |
2366 | 2365 | | |
2367 | | - | |
2368 | 2366 | | |
2369 | 2367 | | |
2370 | 2368 | | |
| |||
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
| 657 | + | |
657 | 658 | | |
658 | 659 | | |
659 | 660 | | |
660 | 661 | | |
| 662 | + | |
661 | 663 | | |
| 664 | + | |
662 | 665 | | |
663 | 666 | | |
664 | 667 | | |
| |||
667 | 670 | | |
668 | 671 | | |
669 | 672 | | |
670 | | - | |
671 | | - | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
672 | 676 | | |
673 | 677 | | |
674 | 678 | | |
| |||
681 | 685 | | |
682 | 686 | | |
683 | 687 | | |
| 688 | + | |
684 | 689 | | |
685 | 690 | | |
686 | 691 | | |
| |||
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
390 | 389 | | |
391 | 390 | | |
392 | 391 | | |
393 | | - | |
394 | | - | |
| 392 | + | |
395 | 393 | | |
396 | 394 | | |
397 | 395 | | |
| |||
510 | 508 | | |
511 | 509 | | |
512 | 510 | | |
| 511 | + | |
513 | 512 | | |
514 | 513 | | |
515 | 514 | | |
| |||
582 | 581 | | |
583 | 582 | | |
584 | 583 | | |
585 | | - | |
| 584 | + | |
586 | 585 | | |
587 | 586 | | |
588 | 587 | | |
| |||
696 | 695 | | |
697 | 696 | | |
698 | 697 | | |
| 698 | + | |
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
| |||
961 | 961 | | |
962 | 962 | | |
963 | 963 | | |
964 | | - | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
965 | 972 | | |
966 | 973 | | |
967 | 974 | | |
| |||
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| 311 | + | |
| 312 | + | |
311 | 313 | | |
312 | 314 | | |
313 | 315 | | |
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
317 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
318 | 323 | | |
319 | 324 | | |
320 | 325 | | |
321 | 326 | | |
322 | 327 | | |
323 | 328 | | |
324 | 329 | | |
325 | | - | |
326 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
327 | 334 | | |
328 | 335 | | |
329 | 336 | | |
| |||
0 commit comments