Skip to content

Commit

Permalink
feat: adding tabbable events (jquense#987)
Browse files Browse the repository at this point in the history
* Adding tabbable events

* Adding button reset & Chrome's default outline for all browsers

* Scoping button reset to .rbc-event

* Moving reset to event.less
  • Loading branch information
schoettler authored and jquense committed Sep 14, 2018
1 parent 1d62c43 commit 6a94e72
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/EventCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class EventCell extends React.Component {

return (
<EventWrapper {...this.props} type="date">
<div
<button
{...props}
style={{ ...userProps.style, ...style }}
className={cn('rbc-event', className, userProps.className, {
Expand All @@ -83,7 +83,7 @@ class EventCell extends React.Component {
onDoubleClick={e => onDoubleClick && onDoubleClick(event, e)}
>
{typeof children === 'function' ? children(content) : content}
</div>
</button>
</EventWrapper>
)
}
Expand Down
10 changes: 9 additions & 1 deletion src/less/event.less
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
@import './variables.less';

.rbc-event {
border: none;
box-shadow: none;
margin: 0;
padding: @event-padding;
background-color: @event-bg;
border-radius: @event-border-radius;
color: @event-color;
cursor: pointer;
width: 100%;
text-align: left;

.rbc-slot-selecting & {
cursor: inherit;
Expand All @@ -15,6 +20,10 @@
&.rbc-selected {
background-color: darken(@event-bg, 10%);
}

&:focus {
outline: 5px auto @event-outline;
}
}

.rbc-event-label {
Expand Down Expand Up @@ -44,4 +53,3 @@
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}

1 change: 1 addition & 0 deletions src/less/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

@event-bg: #3174ad;
@event-border: darken(#3174ad, 10%);
@event-outline: #3b99fc;
@event-color: #fff;
@event-border-radius: 5px;
@event-padding: 2px 5px;
Expand Down

0 comments on commit 6a94e72

Please sign in to comment.