Skip to content

Commit

Permalink
feat(accordion): handle key down & prevent default
Browse files Browse the repository at this point in the history
  • Loading branch information
Leotheluck authored and dpellier committed Jul 29, 2024
1 parent d2750f9 commit 0cf75b2
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class OdsAccordion {
tabIndex={ this.isDisabled ? -1 : 0 }
onClick={ (event) => this.handleClick(event) }
onKeyUp={ (event) => this.handleKeyUp(event) }
onKeyDown={ (event) => event.key === 'Space' && event.preventDefault() }
part="accordion"
ref={ (el) => this.detailsElement = el as HTMLDetailsElement }
>
Expand Down

0 comments on commit 0cf75b2

Please sign in to comment.