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

[4.0][BS5]Bootstrap tab is broken #32116

Closed
joomdonation opened this issue Jan 23, 2021 · 8 comments
Closed

[4.0][BS5]Bootstrap tab is broken #32116

joomdonation opened this issue Jan 23, 2021 · 8 comments

Comments

@joomdonation
Copy link
Contributor

Steps to reproduce the issue

Use the below code to create tab

echo JHtml::_('bootstrap.startTabSet', 'tab', ['active' => 'tab1']);
echo JHtml::_('bootstrap.addTab', 'tab', 'tab1', 'Tab 1 Title');
echo 'Tab 1 Content';
echo JHtml::_('bootstrap.endTab');
echo JHtml::_('bootstrap.addTab', 'tab', 'tab2', 'Tab 2 Title');
echo 'Tab 2 Content';
echo JHtml::_('bootstrap.endTab');
echo JHtml::_('bootstrap.endTabSet');

Expected result

Tabs displayed

Actual result

Tabs are not being displayed

System information (as much as possible)

Joomla 4 nightly build

Additional comments

Maybe we need to wait for PR #31990 merged to have it works ?

@joomdonation joomdonation changed the title [4.0]Bootstrap is broken [4.0]Bootstrap tab is broken Jan 23, 2021
@HLeithner HLeithner changed the title [4.0]Bootstrap tab is broken [4.0][BS5]Bootstrap tab is broken Jan 23, 2021
@joomdonation
Copy link
Contributor Author

@wilsonge I tried again with nightly build today and the issue is still not fixed yet.

@wilsonge wilsonge reopened this Jan 24, 2021
@dgrammatiko
Copy link
Contributor

@joomdonation I think the selector needs to be a CSS selector and you're passing a string (which will result to an element tag tab which obviously doesn't exist)

The example code should make it clear what's broken here: https://github.com/dgrammatiko/bs5/blob/cbd103ddb7e28632d563bdec0a3af6fee4a813f9/test_component/site/tmpl/tab/default.php#L19-L33

@joomdonation
Copy link
Contributor Author

@dgrammatiko The selector actually becomes part of id of the Tabset. We have been using it for years, see the code from staging https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/views/article/tmpl/edit.php#L65

(and just for information, that code has been working at least until recently)

@dgrammatiko
Copy link
Contributor

@joomdonation but does it work if you pass it as a class? The B/C break is something new after the Bootstrap V5 and it might be reverted or patched in a way that will be B/C (undecided at this point).

@joomdonation
Copy link
Contributor Author

@dgrammatiko Yes. If I pass a class selector, then it works

echo JHtml::_('bootstrap.startTabSet', '.tab', ['active' => 'tab1']);
echo JHtml::_('bootstrap.addTab', '.tab', 'tab1', 'Tab 1 Title');
echo 'Tab 1 Content';
echo JHtml::_('bootstrap.endTab');
echo JHtml::_('bootstrap.addTab', '.tab', 'tab2', 'Tab 2 Title');
echo 'Tab 2 Content';
echo JHtml::_('bootstrap.endTab');
echo JHtml::_('bootstrap.endTabSet');

But this is B/C break and should be fixed.

@dgrammatiko
Copy link
Contributor

@joomdonation please test #32146

@joomdonation
Copy link
Contributor Author

Thanks @dgrammatiko . I can confirm that it fixed the reported issue.

@ghost
Copy link

ghost commented Jan 24, 2021

@joomdonation please mark your test as successfully at https://issues.joomla.org/tracker/joomla-cms/32146

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants