Skip to content

Commit

Permalink
Fix modifiers when using cssmodules
Browse files Browse the repository at this point in the history
  • Loading branch information
tume committed Aug 30, 2017
1 parent efd1d6f commit d8387e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/DayPickerInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import moment from 'moment'; // eslint-disable-line import/no-extraneous-depende
import DayPicker from './DayPicker';
import { getModifiersForDay } from './ModifiersUtils';
import { ESC } from './keys';
import classNames from './classNames';

export const HIDE_TIMEOUT = 100;

Expand Down Expand Up @@ -231,11 +232,11 @@ export default class DayPickerInput extends React.Component {
this.props.dayPickerProps.onDayClick(day, modifiers, e);
}

if (modifiers.disabled) {
if (modifiers[this.props.classNames.disabled]) {
// Do nothing if the day is disabled
return;
}
if (modifiers.selected && this.props.clickUnselectsDay) {
if (modifiers[this.props.classNames.selected] && this.props.clickUnselectsDay) {
// Unselect the day
this.setState({ value: '' }, this.hideAfterDayClick);
if (this.props.onDayChange) {
Expand Down

0 comments on commit d8387e4

Please sign in to comment.