Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Kingo64 opened this issue Sep 12, 2019 · 3 comments
Closed
Assignees
Labels
lang/javascript Anything involving JavaScript type/bug Any issue which is a bug or PR which fixes a bug
Milestone

Comments

@Kingo64
Copy link

Kingo64 commented Sep 12, 2019

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

@prudho
Copy link
Contributor

prudho commented Sep 19, 2019

Oh, sorry about that... I did not a anticipated this case 😞

Actually the best fix to provide is to don't check the active tab when a tab was previously initialized. I'll submit a PR soon !

@prudho prudho added type/bug Any issue which is a bug or PR which fixes a bug lang/javascript Anything involving JavaScript labels Sep 19, 2019
@prudho prudho self-assigned this Sep 19, 2019
@prudho prudho added this to the 2.8.0 milestone Sep 19, 2019
@lubber-de
Copy link
Member

Fixed by #1025
See your adjusted jsfiddle here https://jsfiddle.net/bw89drqL/

@Kingo64
Copy link
Author

Kingo64 commented Sep 19, 2019

Thank you!

@lubber-de lubber-de added the tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build label Sep 24, 2019
@y0hami y0hami closed this as completed in 7a9a80c Nov 14, 2019
@y0hami y0hami removed the tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build label Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

No branches or pull requests

4 participants