[beta4] Prevent accordion buttons from submitting forms

Created on 18 August 2023, over 1 year ago
Updated 19 August 2023, over 1 year ago

Problem/Motivation

When an accordion is placed inside a form, opening the accordion using "Enter" key results in the form being submitted.

This happens because there is no `type` attribute on the button, which is the equivalent to type="submit" on all major browsers.

Steps to reproduce

  1. Setup an accordion inside a form.
  2. Using the keyboard to navigate, focus on the accordion button, then press "Enter".
  3. Observe the form being submitted, resulting in the page reloading.

Proposed resolution

Add type="button" on accordion button.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France spryah

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024