Skip to content

Should fading work? #324

@maelle

Description

@maelle

In a PR to pkgdown where we now use bslib for BS4 dependencies, I'm adding the HTML structure for tabsets including support for fading as documented in an R Markdown book.

I'm following the Bootstrap docs.

Here's the HTML I've created: https://60b8c9c243e3b70d06c196c1--pkgdown-dev.netlify.app/dev/articles/test/rendering.html#results-in-tabset-fading-1 where the second tab-panel has the active and show classes, the other panel has the fade class.

<div id="results-in-tabset-fading" class="section level2 tabset tabset-fade">
<h2 class="hasAnchor">
<a href="#results-in-tabset-fading" class="anchor" aria-hidden="true"></a>Results in tabset, fading</h2>


<ul class="nav nav-tabs nav-row" id="results-in-tabset-fading">
<li class=""><a data-toggle="tab" href="#something" role="tab">Something</a></li>
<li class="active"><a data-toggle="tab" href="#nice" role="tab">Nice</a></li>
</ul>
<div class="tab-content">
<div id="something" class="fade tab-pane" role="tabpanel">

<p>ok</p>
<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fl">1</span><span class="op">)</span></code></pre></div>
<p><img src="rendering_files/figure-html/unnamed-chunk-12-1.png" width="700"></p>
<div id="cool-1" class="section level4">
<h4 class="hasAnchor">
<a href="#cool-1" class="anchor" aria-hidden="true"></a>cool</h4>
<p>yay</p>
</div>
</div>
<div id="nice" class="show active fade tab-pane" role="tabpanel">

<p>bonjour</p>
</div>
</div>
</div>

Now if I click on the panels it removes their "fade" class so I see no fading.
I've tried removing the bslib dependencies in favor of CSS+JS for Bootstrap via CDN and I see the fading https://codepen.io/maellesalmon/pen/rNydawa (I've made it super obvious in the pen with a very slow transition).
I guess I am yet again missing something in bslib, and would appreciate any hint. Thanks for the great package in any case!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions