JS calls all links inside tabs, which makes it harder to add to the item_list

Created on 27 May 2022, over 2 years ago
Updated 6 September 2024, 2 months ago

Problem/Motivation

Trying to add an element in the same row as tabs and the link is blocked.

Steps to reproduce

If you add an element to the list ex:

function HOOK_preprocess_item_list__quicktabs__TABNAME(&$variables) {
  $variables['items'][] = ['value' =>  [
    '#type' => 'container',
    'somelink' => \Drupal\Core\Link::createFromRoute('Front', '<front>')->toRenderable(),
  ]];
}

You get a link on the end of tabs but can't click it.

Proposed resolution

This patch literally just adds ">" to make it single level so you can simply put a 'container' around any link you want to work.
$ul.find('li > a').each(function(i, element){

✨ Feature request
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States devitate Orange County, CA

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.

  • Status changed to Needs review 3 months ago
  • πŸ‡¨πŸ‡΄Colombia yasminOrj

    Hi,

    I attempted to replicate the issue as described, but I wasn't able to identify any specific problems or areas for improvement. The tab functionality seems to be working correctly, and it activates the class for the "Front" label as expected.

    If you could provide more details or clarify the issue further, I’d be happy to assist in validating and addressing any concerns.

    Best regards,

Production build 0.71.5 2024