Repository navigation
Commit 2ed43b6
committed
Compose Android keyboardType and secureTextEntry into one input type
keyboardType and secureTextEntry both write the class and variation of the
staged input type, each with bit edits applied in the order the props
arrive. A variation is a value within its class, not a set of flags: 0x10
is TYPE_TEXT_VARIATION_URI in the text class and
TYPE_NUMBER_VARIATION_PASSWORD in the number class. Depending on that
order:
- secureTextEntry={false} clears the url and visible-password variations.
- email-address with secureTextEntry commits
TYPE_TEXT_VARIATION_WEB_EDIT_TEXT, which is not masked.
- secureTextEntry set after autoCapitalize="words" or "characters" commits
text + URI, which is not masked, because checkPasswordType reads the
capitalization flags as the number flags they share bits with.
- Changing keyboardType keeps the previous variation (url then
email-address commits EMAIL_SUBJECT) and the previous number flags.
- phone-pad with secureTextEntry commits a variation the phone class does
not define.
Both setters now only stage their value, and onAfterUpdateTransaction
resolves the class and variation once, before reconcileAutoCapitalize
reads the class, the way autoCapitalize is already deferred. A secure field
takes the password variation of its class, and a class without one keeps
its keyboard.1 parent e0773a7 commit 2ed43b6
3 files changed
Lines changed: 166 additions & 28 deletions
File tree
- packages/react-native/ReactAndroid/src
- main/java/com/facebook/react/views/textinput
- test/java/com/facebook/react/views/textinput
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
| 699 | + | |
| 700 | + | |
710 | 701 | | |
711 | 702 | | |
712 | 703 | | |
| |||
756 | 747 | | |
757 | 748 | | |
758 | 749 | | |
759 | | - | |
760 | | - | |
761 | 750 | | |
762 | 751 | | |
763 | 752 | | |
764 | 753 | | |
765 | 754 | | |
766 | | - | |
767 | | - | |
| 755 | + | |
| 756 | + | |
768 | 757 | | |
769 | 758 | | |
770 | 759 | | |
| |||
905 | 894 | | |
906 | 895 | | |
907 | 896 | | |
| 897 | + | |
908 | 898 | | |
909 | 899 | | |
910 | 900 | | |
| |||
1148 | 1138 | | |
1149 | 1139 | | |
1150 | 1140 | | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
1151 | 1146 | | |
1152 | 1147 | | |
1153 | 1148 | | |
| |||
1192 | 1187 | | |
1193 | 1188 | | |
1194 | 1189 | | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
1205 | | - | |
1206 | | - | |
1207 | | - | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
1208 | 1201 | | |
1209 | 1202 | | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1210 | 1214 | | |
1211 | 1215 | | |
1212 | 1216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
| |||
406 | 412 | | |
407 | 413 | | |
408 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
409 | 524 | | |
410 | 525 | | |
411 | 526 | | |
| |||
656 | 771 | | |
657 | 772 | | |
658 | 773 | | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
659 | 791 | | |
660 | 792 | | |
0 commit comments