Commit 6dad6bf
committed
fix: correct auto-format and phone validation edge cases
Resolves review findings on the Text field format handling:
- stripSeparator treated a whitespace separator as absent, so a space
separator was rendered but never stripped, leaking the grouping
characters into the stored value and payload. Only a genuinely empty
separator now short-circuits.
- parseGroupLengths relied on parseInt alone, silently accepting
partial values such as "3foo" and "3.5" as 3. Tokens are now
validated as whole positive integers before parsing.
- The phone pattern matched digit-free input like "-------" or seven
spaces. A lookahead now requires at least one digit, leaving the
allowed characters, length range, and optional leading "+" unchanged.
- The auto-format group row resolves enableFormatting through
getSettingValue, so the setting works in JS mode as well as literal.1 parent c698713 commit 6dad6bf
2 files changed
Lines changed: 8 additions & 5 deletions
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
59 | | - | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
0 commit comments