- Issue created by @Remco Hoeneveld
The current implementation of field group focus behavior relies on a generic 'error' class, which can lead to unintended focusing issues. This approach causes problems in scenarios where the 'error' class is added for reasons other than form validation, such as conditional values or AJAX rebuilds. As a result, the field group incorrectly focuses on elements that aren't necessarily validation errors, disrupting the user experience, especially when working with complex structures like paragraphs.
1. Install the Field Group module.
2. Install a module that adds conditional error classes (e.g., Maxlength).
3. Create a content type with paragraphs and fields that trigger conditional errors.
4. Edit a node of this content type.
5. Exceed the conditional maxlength on a field within a paragraph.
6. Open a paragraph using AJAX.
7. Observe that the field group JavaScript automatically focuses on the element with the 'error' class, instead of properly opening the paragraph.
1. Introduce a new, specific class 'field-group--error' for field group validation errors.
2. Modify the validation process to add this new class when appropriate.
3. Update the field group JavaScript to focus only on elements with the 'field-group--error' class.
4. Implement these changes as shown in the provided patch.
1. Review and test the provided patch thoroughly.
2. Convert the patch into a Merge Request (MR) for easier collaboration and review.
3. Update unit tests to cover the new functionality.
4. Update documentation to reflect the changes in error handling for field groups.
- None -
- None -
- None -
Needs review
3.6
Miscellaneous