Get default value for closeWidgets from props#28
Open
tn3rb wants to merge 1 commit intowojtekmaj:mainfrom
Open
Get default value for closeWidgets from props#28tn3rb wants to merge 1 commit intowojtekmaj:mainfrom
tn3rb wants to merge 1 commit intowojtekmaj:mainfrom
Conversation
bd58a37 to
ee5b922
Compare
86fa221 to
266aaf2
Compare
72c7698 to
be43aa0
Compare
8686435 to
dc961db
Compare
25ec3b4 to
45d4b9d
Compare
482b348 to
bea162c
Compare
ec35b20 to
fa4cfb0
Compare
6a963a3 to
b018e13
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First off, thank you so much for an amazing suite of date and time picker components you have built.
This PR provides a fix for a super minor bug I found while using
react-datetimerange-pickerin a project.In
DateTimeRangePicker.onDateChange()the default value for thecloseWidgetsparameter is hardcoded totrue:this negates the value of the
closeWidgetsprop passed to the component, since that prop value is never passed toonDateChange()(on line 367, the only place the method is called):So passing
closeWidgets={false}to the component still results in the widget closing whenever the date changes.This PR simply changes that hardcoded value for
closeWidgetsto use the value already in the class props:alternate approaches
if you don't like the above solution then here are some other ways to fix this issue that I would be happy to implement
closeWidgetsfrom props:this may be acceptable because the only place this method is called within the library is from the calendar, which can't possibly pass that prop as is, since it has no access to the datetime range picker's internal props. This unfortunately would not be backwards compatible with any third party code that is utilizing
DateTimeRangePicker.onDateChange()in an external app.onDateChange()prior to passing off to the calendar that receives the new date values and then supplies the value forcloseWidgetsfrom props:So again, would be more than happy to implement one of these other approaches if you prefer one of them over the fix in this PR.
Looking forward to hearing back from you.
Thank you for your time, effort, and talent.