Skip to content

Commit

Permalink
fix(accordion): a11y attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
ErickPetru committed May 20, 2024
1 parent aa22eef commit 2d4171d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ O versionamento deste projeto é aderente aos princípios de [Semantic Versionin

## Unreleased

### Changed

- Melhoria na definição de atributos de acessibilidade no `<cps-accordion>`.

## 0.13.0 - 2024-05-02

### Added
Expand Down
2 changes: 0 additions & 2 deletions docs/componentes/accordion.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

[component-header:cps-accordion]

<div class="background-example">

```html preview
<cps-accordion title="Informações adicionais">
<cps-label>Conteúdo.</cps-label>
Expand Down
3 changes: 1 addition & 2 deletions src/components/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ export default class CpsAccordion extends BaseElement {

return html`
<div
aria-expanded=${this.open ? 'true' : 'false'}
class=${classMap({
accordion: true,
'accordion--open': this.open,
Expand All @@ -135,7 +134,7 @@ export default class CpsAccordion extends BaseElement {
part="base"
title
>
<button aria-controls="content" class="accordion__header" id="header" part="header" @click=${this.click}>
<button aria-controls="content" aria-expanded=${this.open} class="accordion__header" id="header" part="header" type="button" @click=${this.click}>
<div class="accordion__header-content">
<slot class="accordion__header-icon" name="icon" part="icon"></slot>
<span class="accordion__header-title" part="title">${this.title}</span>
Expand Down

0 comments on commit 2d4171d

Please sign in to comment.