GithubHelp home page GithubHelp logo

Nested tabsets about asciidoctor-tabs HOT 3 CLOSED

asciidoctor avatar asciidoctor commented on July 24, 2024
Nested tabsets

from asciidoctor-tabs.

Comments (3)

mojavelinux avatar mojavelinux commented on July 24, 2024 1

Technically, yes, nested tabs are supported. However, the script that manages the behavior is over-matching tab lists and tab panels. This is a side-effect of imprecise CSS selector matching. If the code more carefully selected only the elements for the tabset the user is interacting with, then the nested tabs would work as expected.

any nested tabsets underneath show up as floating tabs without any content or border.

This only means that no tab (and its corresponding panel) is selected.

Here's the sketch of the logic the script needs to use:

forEach.call(tabs.querySelector('.tablist').querySelectorAll('.tab'), function (el) {
  toggleSelected(el, el === tab)
})
var nextPanel = tabs.querySelector('.tabpanel')
while (nextPanel) {
  toggleHidden(nextPanel, nextPanel !== panel)
  if (!(nextPanel = nextPanel.nextElementSibling).classList.contains('tabpanel')) nextPanel = null
}

from asciidoctor-tabs.

eric-schneider avatar eric-schneider commented on July 24, 2024

Thanks for the quick response @mojavelinux! I've tested out the logic you provided and it seems to be working as expected šŸ˜„ I'll continue to monitor this issue for updates on the official release/fix. Once it's available I'll be sure to do more testing as part of our workstream to migrate to the official asciidoctor-tabs extension. Thanks for all your help!

from asciidoctor-tabs.

mojavelinux avatar mojavelinux commented on July 24, 2024

I also found that if a table is contained without a tab in nested tabs, it was getting wrapped in a tablecontainer div twice. The root of the problem is the same. The selector that is used to process tables was going too deep.

from asciidoctor-tabs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.