@@ -7,12 +7,12 @@ import {
77 focusPreviousSiblingOf ,
88} from '../helpers/focus' ;
99import keycodes from '../helpers/keycodes' ;
10- import { DivAttributes } from '../helpers/types' ;
10+ import { ButtonAttributes } from '../helpers/types' ;
1111import { assertValidHtmlId } from '../helpers/uuid' ;
1212
1313import { Consumer as ItemConsumer , ItemContext } from './ItemContext' ;
1414
15- type Props = DivAttributes & {
15+ type Props = ButtonAttributes & {
1616 toggleExpanded ( ) : void ;
1717} ;
1818
@@ -21,7 +21,9 @@ const AccordionItemButton = ({
2121 className = 'accordion__button' ,
2222 ...rest
2323} : Props ) => {
24- const handleKeyPress = ( evt : React . KeyboardEvent < HTMLDivElement > ) : void => {
24+ const handleKeyPress = (
25+ evt : React . KeyboardEvent < HTMLButtonElement > ,
26+ ) : void => {
2527 const keyCode = evt . key ;
2628
2729 if (
@@ -74,10 +76,9 @@ const AccordionItemButton = ({
7476 }
7577
7678 return (
77- < div
79+ < button
7880 className = { className }
7981 { ...rest }
80- role = "button"
8182 tabIndex = { 0 }
8283 onClick = { toggleExpanded }
8384 onKeyDown = { handleKeyPress }
@@ -87,8 +88,8 @@ const AccordionItemButton = ({
8788} ;
8889
8990type WrapperProps = Pick <
90- DivAttributes ,
91- Exclude < keyof DivAttributes , keyof InjectedButtonAttributes >
91+ ButtonAttributes ,
92+ Exclude < keyof ButtonAttributes , keyof InjectedButtonAttributes >
9293> ;
9394
9495const AccordionItemButtonWrapper : React . SFC < WrapperProps > = (
0 commit comments