question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

accordion markup missing flexibility

See original GitHub issue

With the new accordion markup introduced by https://github.com/ng-bootstrap/ng-bootstrap/pull/2368, it is no longer possible to style the header based on its collapsed/expanded state.

Suppose one wants to add a chevron pointing right for closed and down for opened panes:

screen shot 2018-07-02 at 11 41 29

This would be appended to the h5 element like this:

h5 {
        &:after {
            font: normal normal normal 18px/1 FontAwesome;
            content: "\f054";
            margin-top: 4px;
            float: right;
            color: white;
        }

With the new markup, there is no way to get the collapsed/expanded state at the level where style needs to be applied because it is only represented on the button child element. In the previous markup, there was a a element which had the expanded style.

In my view, ng-bootstrap should apply a class at the .card-header level to allow for such styling.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
pvelez-bp3commented, Sep 11, 2018

Trying to put a button or an anchor with a different action than toggle the content into the title(ngbPanelTitle) does not work in IE11 and firefox because of Content model for button: “Phrasing content, but there must be no interactive content descendant”. Any clue on how to make this work?

0reactions
pkozlowski-opensourcecommented, Jul 6, 2018

I tend to agree with @benouat analysis - the same work-around should be possible with new markup. Please let us know if something is still blocking so we can have a look.

In any case we want to introduce more flexibility for styling / marking up accordion title via existing issues (#465, #717).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stop bootstrap accordion panel collapsing on form submit
I have a form inside a Bootstrap 3 collapsible panel. The form is an asp.net DetailsView control with EDIT and DELETE buttons. When...
Read more >
Flexibility in page design - Getting Started - ProcessWire
What I like about Contao is the great flexibility when creating pages/articles - each article is pieced together with content elements (text, ...
Read more >
Easy Accordion – Best Accordion FAQ Plugin for WordPress
The best responsive and drag & drop Accordion FAQ builder plugin. User-friendly, Highly Customizable & Intuitive Shortcode Generator.
Read more >
A Complete Guide To Accessible Front-End Components
An up-to-date collection of accessible front-end components: accordions, form styles, dark mode, data charts, date pickers, form styles, ...
Read more >
Dynamically Adding An Accordion Pane (C#) - Microsoft Learn
The Accordion control in the AJAX Control Toolkit provides multiple ... Add(new LiteralControl("Adding panes using code is really flexible.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found