From f205711aa27b132e97d416623552d26eeda2686d Mon Sep 17 00:00:00 2001 From: Hannes Vandevelde Date: Thu, 21 Jun 2018 15:27:01 +0200 Subject: [PATCH 1/2] Added extra check in dayclick. --- src/DayPickerInput.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/DayPickerInput.js b/src/DayPickerInput.js index 2bf963851e..0b5da787dc 100644 --- a/src/DayPickerInput.js +++ b/src/DayPickerInput.js @@ -454,7 +454,11 @@ export default class DayPickerInput extends React.Component { } // Do nothing if the day is disabled - if (modifiers.disabled) { + if ( + modifiers.disabled || + (dayPickerProps.classNames && + modifiers[dayPickerProps.classNames.disabled]) + ) { return; } From 380acea6547cf2c19b44b6f10331437cb643a434 Mon Sep 17 00:00:00 2001 From: Hannes Vandevelde Date: Thu, 21 Jun 2018 15:31:54 +0200 Subject: [PATCH 2/2] Extra check. --- src/DayPickerInput.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DayPickerInput.js b/src/DayPickerInput.js index 0b5da787dc..b4b7cd3137 100644 --- a/src/DayPickerInput.js +++ b/src/DayPickerInput.js @@ -456,7 +456,8 @@ export default class DayPickerInput extends React.Component { // Do nothing if the day is disabled if ( modifiers.disabled || - (dayPickerProps.classNames && + (dayPickerProps && + dayPickerProps.classNames && modifiers[dayPickerProps.classNames.disabled]) ) { return;