Skip to content

Commit

Permalink
fix(sbb-flip-card): use type button to avoid accidental form submissi…
Browse files Browse the repository at this point in the history
…on (#3002)
  • Loading branch information
jeripeierSBB authored Aug 15, 2024
1 parent 941a569 commit 25dbd78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ snapshots["sbb-flip-card Shadow DOM"] =
<button
aria-expanded="false"
class="sbb-flip-card-button"
type="button"
>
<sbb-screen-reader-only>
Summary, Click on this card for details
Expand Down
6 changes: 5 additions & 1 deletion src/elements/flip-card/flip-card/flip-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ export class SbbFlipCardElement extends SbbHydrationMixin(LitElement) {
protected override render(): TemplateResult {
return html`
<div class="sbb-flip-card">
<button class="sbb-flip-card-button" aria-expanded=${this._flipped.toString()}>
<button
class="sbb-flip-card-button"
aria-expanded=${this._flipped.toString()}
type="button"
>
<sbb-screen-reader-only>${until(this._accessibilityLabel(), '')}</sbb-screen-reader-only>
</button>
<slot name="summary" @slotchange=${() => (this.summary!.inert = this._flipped)}></slot>
Expand Down

0 comments on commit 25dbd78

Please sign in to comment.