Unintended tab switch if used together with field group

Created on 16 February 2024, 9 months ago
Updated 1 March 2024, 9 months ago

Problem/Motivation

If paragrphs_ee is used together with the "Field Group" module and the patch https://www.drupal.org/project/field_group/issues/2969051 🐛 HTML5 Validation Prevents Submission in Tabs Postponed: needs info in an entity-edit-form, it will switch between different tabs if there are required fields in multiple tabs.
The code provided in the field group patch is executed for any click on DOM elements with the class "form-submit" and starts to validate the form. If all required fields in one Tab are filled and the user tries to add paragraphs via "Add-In-Between-More" buttons, tabs are switched because of the form validation.
The patch excludes elements with the attribute "formnovalidate". Because add-in-between buttons do not need to validate the from, this is the proposed solution.

Steps to reproduce

* Project with paragraphs_ee, field_group and the mentioned field_group patch
* Add at least two fieldgroup tabs to an entity-edit-form with configured paragraphs entity-reference-revision field in the first tab
* make sure both tabs contain required fields
* make sure Use off-canvas is disabled for paragraphs_ee field in form display.
* fill in required fields in the first tab and add a paragraph via add-in-between
* the tab switches to the 2nd tab

Proposed resolution

* add "formnovalidate" attribute to "Add in between" Buttons

Remaining tasks

* provide the patch

🐛 Bug report
Status

Fixed

Version

10.0

Component

Code

Created by

🇮🇳India sahal_va

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024