Skip to content

Commit d3e12de

Browse files
committed
Focus ring now shows up around custom navigation buttons
1 parent dd1ab72 commit d3e12de

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,6 @@ yarn.lock
4747
package-lock.json
4848

4949
css/styles.css
50+
51+
# Cache
52+
.cache/

src/components/DayPickerNavigation.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function DayPickerNavigation({
126126
{!isVerticalScrollable && (
127127
<div
128128
role="button"
129-
tabIndex="0"
129+
tabIndex={isDefaultNavPrev ? '0' : null}
130130
{...css(
131131
styles.DayPickerNavigation_button,
132132
isDefaultNavPrev && styles.DayPickerNavigation_button__default,
@@ -164,7 +164,7 @@ function DayPickerNavigation({
164164

165165
<div
166166
role="button"
167-
tabIndex="0"
167+
tabIndex={isDefaultNavNext ? '0' : null}
168168
{...css(
169169
styles.DayPickerNavigation_button,
170170
isDefaultNavNext && styles.DayPickerNavigation_button__default,

stories/DayPicker.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,37 @@ import {
1010
} from '../src/constants';
1111

1212
const TestPrevIcon = () => (
13-
<span
13+
<div
1414
style={{
1515
border: '1px solid #dce0e0',
1616
backgroundColor: '#fff',
1717
color: '#484848',
18+
left: '24px',
1819
padding: '3px',
20+
position: 'absolute',
21+
width: '40px',
1922
}}
23+
tabindex="0"
2024
>
2125
Prev
22-
</span>
26+
</div>
2327
);
2428

2529
const TestNextIcon = () => (
26-
<span
30+
<div
2731
style={{
2832
border: '1px solid #dce0e0',
2933
backgroundColor: '#fff',
3034
color: '#484848',
3135
padding: '3px',
36+
position: 'absolute',
37+
right: '24px',
38+
width: '40px',
3239
}}
40+
tabindex="0"
3341
>
3442
Next
35-
</span>
43+
</div>
3644
);
3745

3846
const TestCustomInfoPanel = () => (

0 commit comments

Comments
 (0)