Skip to content

Commit

Permalink
feat(react): add option to closeOnSelect (#11597)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
abbeyhrt and kodiakhq[bot] authored Jun 13, 2022
1 parent 8d8e1b6 commit c8e989b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2157,6 +2157,9 @@ Map {
"className": Object {
"type": "string",
},
"closeOnSelect": Object {
"type": "bool",
},
"dateFormat": Object {
"type": "string",
},
Expand Down
7 changes: 7 additions & 0 deletions packages/react/src/components/DatePicker/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ function DatePicker({
appendTo,
children,
className,
closeOnSelect = true,
dateFormat = 'm/d/Y',
datePickerType,
disable,
Expand Down Expand Up @@ -286,6 +287,7 @@ function DatePicker({
inline: inline ?? false,
disableMobile: true,
defaultDate: value,
closeOnSelect: closeOnSelect,
mode: datePickerType,
allowInput: allowInput ?? true,
dateFormat: dateFormat,
Expand Down Expand Up @@ -488,6 +490,11 @@ DatePicker.propTypes = {
*/
className: PropTypes.string,

/**
* flatpickr prop passthrough. Controls whether the calendar dropdown closes upon selection.
*/
closeOnSelect: PropTypes.bool,

/**
* The date format.
*/
Expand Down

0 comments on commit c8e989b

Please sign in to comment.