Conversation
| {this.props.phrases.closeDatePicker} | ||
| </span> | ||
| <CloseButton /> | ||
| <div className="DateRangePickerInput__close"> |
There was a problem hiding this comment.
This class name is wrong. You're not inside the input.
| padding: '3px', | ||
| }} | ||
| > | ||
| {'X'} |
| showClearDates | ||
| customCloseIcon={<span className="custom-close-icon" />} | ||
| />); | ||
| expect(wrapper.find('.DateRangePickerInput__calendar-icon .custom-close-icon')); |
There was a problem hiding this comment.
This should fail... why would it be under .DateRangePickerInput__calendar-icon? Why isn't this failing?
majapw
left a comment
There was a problem hiding this comment.
I'm concerned about the test, plus we need parallel tests for the SingleDatePicker components.
48e136c to
09fd248
Compare
f30d5fb to
3f95071
Compare
|
@majapw I've added a corresponding spec for SingleDatePicker. The spec you pointed out wasn't failing because it accidentally didn't have any assertions, only a dangling |
| showClearDates | ||
| customCloseIcon={<span className="custom-close-icon" />} | ||
| />); | ||
| expect(wrapper.find('.DateRangePickerInput__calendar-icon .custom-close-icon')); |
There was a problem hiding this comment.
You now have the same problem here in this spec...
0a31762 to
6d45150
Compare
|
Correct me if I'm wrong, but shouldn't this whole thing rather be called "custom CLEAR icon"? |
|
It closes the datepicker, it doesn't clear the dates. |
|
It actually does both... We overload the icon in use, so uh, I get the Q |
|
Lol well there you go |
|
@majapw can we unoverload them? |
|
I ran into the same issue as @zeemawn. I spent a good couple hours thinking that I could add a custom close icon to the default state, only to find out that it was only implemented for the |
@majapw @ljharb
Adds a
customCloseIconprop to allow overriding the default<CloseButton />. I matched the behavior ofcustomArrowIcon: default prop of null, fallback to original component insiderender, and a wrapping css class.