Add autocomplete attribute to name field#2592
Conversation
WalkthroughThe pull request adds autocomplete attribute support to form name fields. The first and last name subfield definitions are restructured to include autocomplete metadata (given-name and family-name), and the combo-field template is updated to render this autocomplete attribute on form inputs. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.1.32)Invalid configuration: Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
classes/models/fields/FrmFieldName.php (1)
40-48: Parent class correctly handles mixed array/string format—optional refactor improves consistency.Verification confirms
FrmFieldCombo::register_sub_fields()properly normalizes both array and string formats (FrmFieldCombo.php lines 61-72), so the data structure change is compatible. All downstream access patterns treat sub_fields as arrays, which works correctly.The 'middle' field uses string format while 'first' and 'last' are now arrays. While this mixed format functions correctly, adding autocomplete support to the middle field improves consistency:
- 'middle' => __( 'Middle Name', 'formidable' ), + 'middle' => array( + 'label' => __( 'Middle Name', 'formidable' ), + 'autocomplete' => 'additional-name', + ),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
classes/models/fields/FrmFieldName.php(1 hunks)classes/views/frm-fields/front-end/combo-field/combo-field.php(1 hunks)
🔇 Additional comments (1)
classes/views/frm-fields/front-end/combo-field/combo-field.php (1)
72-74: LGTM! Clean implementation of autocomplete support.The conditional attribute addition follows the existing pattern and correctly delegates HTML escaping to
FrmAppHelper::array_to_html_params()on line 77. This enhances UX by enabling browser autofill for name fields.
|
Closing this because of a new solution #2595 |
Fixes https://github.com/Strategy11/formidable-pro/issues/6099