This property change allows a function to be passed to calendarPlacement in addition to a string. This fixes #104.
Description
Implemented a getCalendarPlacement method that executes the function that is passed by props, if present, or returns the string value. The React.PropTypes validation ensures that those are the only two possible types.
The getCalendarPlacement function is executed in the onFocus handler (handleFocus) where the focused state is set to true. I did this so as to avoid recalculating calling the function in unnecessary scenarios (like when the pop-up is closing).
Added 2 tests, one testing using a string to set the calendar placement and another test uses a function.
Updated example app and documentation.
Motivation and Context
This is explained in further detail in #104
How Has This Been Tested?
Tested on the following with all unit tests passing:
Chrome 56.0.2924 (Mac OS X 10.12.4)
Safari 10.1.0 (Mac OS X 10.12.4)
I also created two scenarios in the example app showcasing the functionality, and where one can see that previous functionality remains intact.
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project. (let me know if something is amiss!)
[x] My change requires a change to the documentation.
This property change allows a function to be passed to calendarPlacement in addition to a string. This fixes #104.
Description
Motivation and Context
This is explained in further detail in #104
How Has This Been Tested?
Tested on the following with all unit tests passing:
I also created two scenarios in the example app showcasing the functionality, and where one can see that previous functionality remains intact.
Types of changes
Checklist: