Skip to content
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

Fix for RangeCalendar onClear not working #653

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/RangeCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ class RangeCalendar extends React.Component<RangeCalendarProps, RangeCalendarSta
enablePrev
enableNext={!isClosestMonths || this.isMonthYearPanelShow(mode[1])}
clearIcon={clearIcon}
onClear={this.clear}
/>
<span className={`${prefixCls}-range-middle`}>{seperator}</span>
<CalendarPart
Expand All @@ -826,6 +827,7 @@ class RangeCalendar extends React.Component<RangeCalendarProps, RangeCalendarSta
enablePrev={!isClosestMonths || this.isMonthYearPanelShow(mode[0])}
enableNext
clearIcon={clearIcon}
onClear={this.clear}
/>
</div>
<div className={cls}>
Expand Down
2 changes: 2 additions & 0 deletions src/range-calendar/CalendarPart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const CalendarPart: React.FC<CalendarPartProps> = props => {
enablePrev,
enableNext,
clearIcon,
onClear,
showClear,
inputMode,
} = props;
Expand Down Expand Up @@ -120,6 +121,7 @@ const CalendarPart: React.FC<CalendarPartProps> = props => {
placeholder={placeholder}
value={value as Moment}
showClear={showClear || false}
onClear={onClear}
selectedValue={selectedValue[index]}
onChange={onInputChange}
onSelect={onInputSelect}
Expand Down
7 changes: 7 additions & 0 deletions tests/__snapshots__/FullCalendar.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ exports[`FullCalendar renders date mode correctly 1`] = `
aria-owns="undefined_list"
autocomplete="off"
class="rc-select-selection-search-input"
readonly=""
role="combobox"
style="opacity:0"
value=""
Expand Down Expand Up @@ -764,6 +765,7 @@ exports[`FullCalendar renders date mode correctly 1`] = `
aria-owns="undefined_list"
autocomplete="off"
class="rc-select-selection-search-input"
readonly=""
role="combobox"
style="opacity:0"
value=""
Expand Down Expand Up @@ -1503,6 +1505,7 @@ exports[`FullCalendar renders fullscreen correctly 1`] = `
aria-owns="undefined_list"
autocomplete="off"
class="rc-select-selection-search-input"
readonly=""
role="combobox"
style="opacity:0"
value=""
Expand Down Expand Up @@ -1543,6 +1546,7 @@ exports[`FullCalendar renders fullscreen correctly 1`] = `
aria-owns="undefined_list"
autocomplete="off"
class="rc-select-selection-search-input"
readonly=""
role="combobox"
style="opacity:0"
value=""
Expand Down Expand Up @@ -2282,6 +2286,7 @@ exports[`FullCalendar renders month mode correctly 1`] = `
aria-owns="undefined_list"
autocomplete="off"
class="rc-select-selection-search-input"
readonly=""
role="combobox"
style="opacity:0"
value=""
Expand Down Expand Up @@ -2510,6 +2515,7 @@ exports[`FullCalendar type renders defaultType correctly 1`] = `
aria-owns="undefined_list"
autocomplete="off"
class="rc-select-selection-search-input"
readonly=""
role="combobox"
style="opacity:0"
value=""
Expand Down Expand Up @@ -2550,6 +2556,7 @@ exports[`FullCalendar type renders defaultType correctly 1`] = `
aria-owns="undefined_list"
autocomplete="off"
class="rc-select-selection-search-input"
readonly=""
role="combobox"
style="opacity:0"
value=""
Expand Down