Skip to content

[Tab] Auto-activate doesn't check siblings, breaks individual tab definitions #1014

@Kingo64

Description

@Kingo64

Bug Report

Steps to reproduce

  1. Initialise a menu with tabs
  2. Initialise/modify a single tab in the menu
  3. Menu now selects the last modified tab as the 'active' tab incorrectly as it fails to check for siblings

Expected result

Individual tab should update without affecting the other tab members in the menu.

Actual result

Last modified tab gets set as the 'active' tab in the menu regardless of actual state.

Testcase

Demonstration:
https://jsfiddle.net/spj408zw/

Proposed solution

Modify line 697 on tab.js from:
$anchor = $allModules.filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]')

To:
$anchor = $allModules.siblings().filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]')

Worst case scenario, roll back #977 as it introduces issues that were not present before.

Caused by

#977

Version

2.7.8

Metadata

Metadata

Assignees

Labels

lang/javascriptAnything involving JavaScripttype/bugAny issue which is a bug or PR which fixes a bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions