-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[DatePicker] Fix bug where 'isSelectedDateDisabled' was returning undefined #7735
Conversation
@@ -98,7 +100,11 @@ class Calendar extends Component { | |||
return false; | |||
} | |||
|
|||
return this.refs.calendar.isSelectedDateDisabled(); | |||
if (this.calendarRefs.calendar) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this check needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most probably not, but I like to check for refs just to be safe and have a fallback, as I've run into errors before. Most probably just got to do with hot-reloading though...
I could remove it if you like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep it that way.
@lostpebble Thanks |
* call_em_all_-_master/master: [EnhancedButton] -- Prevent href being overwritten by undefined. (mui#8103) [CardMedia] Guard against null children and overlays (mui#8055) [Docs] Add v0.19.1 to versions.json v0.19.1 [CHANGELOG] Prepare v0.19.1 Have the InkBar in the Tabs component honor the value prop (mui#8010) [AutoComplete] Fix bug where controlled component behaves uncontrolled. (mui#7967) stop preventing event default on iconmenu open (mui#7933) Fix PopOver animation origin when horizontal=middle (mui#7930) [Slider] Resolve slider value to respect max and min (mui#7863) Update onNewRequest documentation to explain chosenRequest returns dataSource value. (mui#7835) [Docs] Add v0.19.0 to versions.json v0.19.0 [CHANGELOG] Prepare v0.19.0 [core] Add react^16.0.0-beta.5 in peer dependencies [DatePicker] Fixed bug where 'isSelectedDateDisabled' was returning undefined (mui#7735) Create CODE_OF_CONDUCT.md (mui#7704) Update related projects. (mui#7706) # Conflicts: # src/internal/EnhancedButton.js
Found that using Date Picker in React v16 Beta was returning with this bug again. (as seen before in https://github.com/callemall/material-ui/issues/1224)
Could be something to do with the way refs are handled. Just changed the ref over from a string ref to the recommended way of using a ref function.