Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit f2df576

Browse files
authored
Merge pull request #9 from rpearce/change-default-element
Change default element from div to span
2 parents 14d32df + 758785b commit f2df576

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

docs/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23757,7 +23757,7 @@ function (_PureComponent) {
2375723757

2375823758
exports.ButtonA11y = ButtonA11y;
2375923759
ButtonA11y.defaultProps = {
23760-
element: 'div',
23760+
element: 'span',
2376123761
onClick: Function.prototype,
2376223762
onKeyDown: Function.prototype,
2376323763
strictMode: true

source/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class ButtonA11y extends PureComponent {
4545
}
4646

4747
ButtonA11y.defaultProps = {
48-
element: 'div',
48+
element: 'span',
4949
onClick: Function.prototype,
5050
onKeyDown: Function.prototype,
5151
strictMode: true

test/__snapshots__/index.test.js.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`ButtonA11y component renders, children 1`] = `
4-
<div
4+
<span
55
aria-label="Mock Label"
66
className="mock-className"
77
onClick={[MockFunction]}
@@ -10,11 +10,11 @@ exports[`ButtonA11y component renders, children 1`] = `
1010
tabIndex="0"
1111
>
1212
Click me
13-
</div>
13+
</span>
1414
`;
1515

1616
exports[`ButtonA11y component renders, no children 1`] = `
17-
<div
17+
<span
1818
aria-label="Mock Label"
1919
className="mock-className"
2020
onClick={[MockFunction]}
@@ -28,10 +28,10 @@ exports[`ButtonA11y component renders, ref passed in 1`] = `
2828
<ButtonA11y
2929
aria-label="Mock Label"
3030
className="mock-className"
31-
element="div"
31+
element="span"
3232
forwardedRef={
3333
Object {
34-
"current": <div
34+
"current": <span
3535
aria-label="Mock Label"
3636
class="mock-className"
3737
role="button"
@@ -43,7 +43,7 @@ exports[`ButtonA11y component renders, ref passed in 1`] = `
4343
onKeyDown={[Function]}
4444
strictMode={true}
4545
>
46-
<div
46+
<span
4747
aria-label="Mock Label"
4848
className="mock-className"
4949
onClick={[MockFunction]}
@@ -66,7 +66,7 @@ exports[`ButtonA11y component renders, span element 1`] = `
6666
`;
6767

6868
exports[`ButtonA11y component renders, strict mode disabled 1`] = `
69-
<div
69+
<span
7070
aria-label="Mock Label"
7171
className="mock-className"
7272
onClick={[MockFunction]}
@@ -80,7 +80,7 @@ exports[`ButtonA11y container renders 1`] = `
8080
<ButtonA11y
8181
aria-label="Mock Label"
8282
className="mock-className"
83-
element="div"
83+
element="span"
8484
forwardedRef={null}
8585
onClick={[MockFunction]}
8686
onKeyDown={[Function]}

test/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('ButtonA11y', () => {
3131
ref={ref}
3232
/>
3333
)
34-
expect(ref.current).toBeInstanceOf(HTMLDivElement)
34+
expect(ref.current).toBeInstanceOf(HTMLSpanElement)
3535
})
3636

3737
})

0 commit comments

Comments
 (0)