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

fix(accordion): do not use static header level for heading #2915

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

peterblazejewicz
Copy link
Contributor

@peterblazejewicz peterblazejewicz commented Dec 9, 2018

As discussed in #2847, this PR:

Thanks!

@codecov-io
Copy link

codecov-io commented Dec 9, 2018

Codecov Report

Merging #2915 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2915      +/-   ##
==========================================
- Coverage   91.23%   91.21%   -0.02%     
==========================================
  Files          89       89              
  Lines        2885     2879       -6     
  Branches      475      472       -3     
==========================================
- Hits         2632     2626       -6     
  Misses        181      181              
  Partials       72       72
Impacted Files Coverage Δ
src/accordion/accordion.ts 98.5% <ø> (ø) ⬆️
src/timepicker/timepicker.ts 98.68% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d01940...5ddacc0. Read the comment docs.

Copy link
Member

@maxokorokov maxokorokov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @peterblazejewicz, thanks for the PR!

I've just read WAI-ARIA documentation and opened #2927 to address differences.
I don't think just adding role=heading on top of role=tab is a good solution.

So if you don't mind let's transform this to the fix(accordion) and

Cheers

@peterblazejewicz peterblazejewicz changed the title feat(accordion): do not use static header level for heading fix(accordion): do not use static header level for heading Dec 13, 2018
@peterblazejewicz
Copy link
Contributor Author

@maxokorokov
Done, squashed and rebased.
I've probably misread the docs and fully agree with you, cheers!

@@ -115,13 +115,13 @@ export interface NgbPanelChangeEvent {
<ng-template ngFor let-panel [ngForOf]="panels">
<div class="card">
<div role="tab" id="{{panel.id}}-header" [class]="'card-header ' + (panel.type ? 'bg-'+panel.type: type ? 'bg-'+type : '')">
<h5 class="mb-0">
<div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you think that in this case we can remove this element altogether? It doesn't affect rendering, so I don't see any reasons in having it at all (that was the second part of my previous review).

On the bootstrap side they've changed example from <h5><h2>, but again it's just an example. Any kind of markup could be put into cards.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, removed the wrapping div completely in the updated version.
Thanks!

- replace h5 header tag with div tag

Thanks!
@maxokorokov
Copy link
Member

LGTM, thanks!

@troddick
Copy link

After updating to 4.0.2, I'm still seeing the header text running out of the container. I thought it may be my code, so I tested on the StackBlitz on the components/accordion/examples page. It is still running over rather than word-wrapping there too. Am I missing something?
Thanks!
https://stackblitz.com/edit/angular-ukshlz?file=app/accordion-basic.html

@peterblazejewicz
Copy link
Contributor Author

@troddick
Hey, you need to use BS in version at least 4.2.1 to have at least text that wraps in buttons used in accordions (collapse):
twbs/bootstrap@24bdadf#diff-8a4fc4262c9197c73b80fb80d8863ae5

After updating to 4.0.2

This is the BS version used in your SBlitz

@troddick
Copy link

That did it! I didn't realize I needed to update BS also. It's working for me now.
Thanks!!

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

Successfully merging this pull request may close these issues.

None yet

4 participants