Select2 field doesn't work when inside a Tab field group

Created on 29 July 2021, over 3 years ago
Updated 5 May 2023, over 1 year ago

Problem/Motivation

Seems like we cannot place an entity reference field that uses Select2 inside a tabs field group.
The widget loads incorrectly and I get Uncaught TypeError: e(...).select2 is not a function.
Got the same error on Claro and Gin themes.

Steps to reproduce

Using Drupal 9.2.2, PHP 7.4:

  1. Install and enable Select2./li>
  2. Create a simple taxonomy vocabulary and add a few terms.
  3. In a content type, add a field that is a taxonomy term reference to the vocabulary, multiple cardinality. I named mine TOPIC
  4. In form display, use widget Select2
  5. Add a Field Group Tabs
  6. Add a Field Group Tab

Nest it like:

Tabs
--Tabs
---- Your Reference field that uses Select 2 (TOPIC)

Save and try adding a content, should not work:

incorrect screenshot β†’

Remove the field from nesting, should work:
correct screenshot β†’

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Postponed: needs info

Version

1.0

Component

Field widgets

Created by

πŸ‡¨πŸ‡¦Canada gwvoigt London, ON πŸ‡¨πŸ‡¦

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024