Skip to content

Commit 6a94e72

Browse files
schoettlerjquense
authored andcommitted
feat: adding tabbable events (#987)
* Adding tabbable events * Adding button reset & Chrome's default outline for all browsers * Scoping button reset to .rbc-event * Moving reset to event.less
1 parent 1d62c43 commit 6a94e72

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/EventCell.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class EventCell extends React.Component {
7070

7171
return (
7272
<EventWrapper {...this.props} type="date">
73-
<div
73+
<button
7474
{...props}
7575
style={{ ...userProps.style, ...style }}
7676
className={cn('rbc-event', className, userProps.className, {
@@ -83,7 +83,7 @@ class EventCell extends React.Component {
8383
onDoubleClick={e => onDoubleClick && onDoubleClick(event, e)}
8484
>
8585
{typeof children === 'function' ? children(content) : content}
86-
</div>
86+
</button>
8787
</EventWrapper>
8888
)
8989
}

src/less/event.less

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
@import './variables.less';
22

33
.rbc-event {
4+
border: none;
5+
box-shadow: none;
6+
margin: 0;
47
padding: @event-padding;
58
background-color: @event-bg;
69
border-radius: @event-border-radius;
710
color: @event-color;
811
cursor: pointer;
12+
width: 100%;
13+
text-align: left;
914

1015
.rbc-slot-selecting & {
1116
cursor: inherit;
@@ -15,6 +20,10 @@
1520
&.rbc-selected {
1621
background-color: darken(@event-bg, 10%);
1722
}
23+
24+
&:focus {
25+
outline: 5px auto @event-outline;
26+
}
1827
}
1928

2029
.rbc-event-label {
@@ -44,4 +53,3 @@
4453
border-bottom-left-radius: 0;
4554
border-bottom-right-radius: 0;
4655
}
47-

src/less/variables.less

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
@event-bg: #3174ad;
1818
@event-border: darken(#3174ad, 10%);
19+
@event-outline: #3b99fc;
1920
@event-color: #fff;
2021
@event-border-radius: 5px;
2122
@event-padding: 2px 5px;

0 commit comments

Comments
 (0)