-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Restrict processing of tab items to immediate children #21159
Conversation
media/legacy/js/bootstrap-init.js
Outdated
@@ -157,8 +157,7 @@ | |||
/** Tabs **/ | |||
if (tabs) { | |||
$.each(tabs, function(index, value) { | |||
|
|||
$.each($('#' + index + 'Content').find('.tab-pane'), function(i, v) { | |||
$('#' + index + 'Content').children('.tab-pane').each(function(i, v) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 8 spaces but found 4 tabs indent
Unexpected tab character no-tabs
Unexpected string concatenation prefer-template
Unexpected unnamed function func-names
Unexpected function expression prefer-arrow-callback
Missing space before function parentheses space-before-function-paren
@@ -158,7 +158,7 @@ | |||
if (tabs) { | |||
$.each(tabs, function(index, value) { | |||
|
|||
$.each($('#' + index + 'Content').find('.tab-pane'), function(i, v) { | |||
$('#' + index + 'Content').children('.tab-pane').each(function(i, v) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 8 spaces but found 4 tabs indent
Unexpected tab character no-tabs
Unexpected string concatenation prefer-template
Unexpected unnamed function func-names
Unexpected function expression prefer-arrow-callback
Missing space before function parentheses space-before-function-paren
@dgrammatiko is this still a problem in J4? |
These scripts don't appear to be available / used anymore. Closing. |
Summary of Changes
When creating a new tabset within an existing tabset, using JHtml::_('bootstrap.startTabSet') etc., the tab items of the new tabset will be appended to the existing "parent" tabset.
This PR changes the selector for the jQuery iterator so that only the immediate "tab-pane" children of the tab content div are targeted and not all "tab-pane" nodes in the content div.
Testing Instructions
This is difficult to test without creating a new component or heavily editing an existing one, but the issue can be seen in markup like this:
Expected result
A new set of tabs is created inside the existing tabset.
Actual result
The "Left1" tab item is appended to the "tabs-tab1" set, below "Tab1"
Documentation Changes Required
None.