Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding tabbable events #987

Merged
merged 4 commits into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 7 additions & 2 deletions src/less/event.less
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
@import './variables.less';

.rbc-event {
button.rbc-event {
padding: @event-padding;
background-color: @event-bg;
border-radius: @event-border-radius;
color: @event-color;
cursor: pointer;
width: 100%;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead lets do display:block; maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

display: block doesn't seem to apply the full width, how about both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm display: block seems to ruin the +5 more behaviour when events can't fit vertically

text-align: left;

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

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

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

8 changes: 8 additions & 0 deletions src/less/reset.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ button.rbc-input::-moz-focus-inner {
border: 0;
padding: 0;
}

button.rbc-event {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its fine to move this up to the event.less file and combine the selector

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under the same .rbc-event rule of event.less?

padding: 0;
margin: 0;
border: none;
box-shadow: none;
background: none;
}
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