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

Set type="button" on accordion buttons #1468

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Re-added EuiI18n, EuiI18nNumber, and EuiContext for localization ([#1466](https://github.com/elastic/eui/pull/1466))
- Set `type="button"` on accordion buttons ([#1468](https://github.com/elastic/eui/pull/1468))

## [`6.6.0`](https://github.com/elastic/eui/tree/v6.6.0)

Expand Down
7 changes: 7 additions & 0 deletions src/components/accordion/__snapshots__/accordion.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ exports[`EuiAccordion behavior closes when clicked twice 1`] = `
aria-expanded={false}
className="euiAccordion__button"
onClick={[Function]}
type="button"
>
<EuiFlexGroup
alignItems="center"
Expand Down Expand Up @@ -167,6 +168,7 @@ exports[`EuiAccordion behavior opens when clicked once 1`] = `
aria-expanded={true}
className="euiAccordion__button"
onClick={[Function]}
type="button"
>
<EuiFlexGroup
alignItems="center"
Expand Down Expand Up @@ -283,6 +285,7 @@ exports[`EuiAccordion is rendered 1`] = `
aria-controls="0"
aria-expanded="false"
class="euiAccordion__button"
type="button"
>
<div
class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow"
Expand Down Expand Up @@ -346,6 +349,7 @@ exports[`EuiAccordion props buttonContent is rendered 1`] = `
aria-controls="2"
aria-expanded="false"
class="euiAccordion__button"
type="button"
>
<div
class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow"
Expand Down Expand Up @@ -413,6 +417,7 @@ exports[`EuiAccordion props buttonContentClassName is rendered 1`] = `
aria-controls="1"
aria-expanded="false"
class="euiAccordion__button"
type="button"
>
<div
class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow"
Expand Down Expand Up @@ -476,6 +481,7 @@ exports[`EuiAccordion props extraAction is rendered 1`] = `
aria-controls="3"
aria-expanded="false"
class="euiAccordion__button"
type="button"
>
<div
class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow"
Expand Down Expand Up @@ -546,6 +552,7 @@ exports[`EuiAccordion props initialIsOpen is rendered 1`] = `
aria-controls="4"
aria-expanded="true"
class="euiAccordion__button"
type="button"
>
<div
class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow"
Expand Down
1 change: 1 addition & 0 deletions src/components/accordion/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export class EuiAccordion extends Component {
aria-expanded={!!this.state.isOpen}
onClick={this.onToggle}
className={buttonClasses}
type="button"
>
<EuiFlexGroup gutterSize="s" alignItems="center" responsive={false}>
<EuiFlexItem grow={false} className="euiAccordion__iconWrapper">
Expand Down