Fix SingleDatePicker when appendToBody is enabled.
Fixes #1550
Disclaimer: this fix is probably very naive and I make it for the sole purpose of bringing attention of contributors and maintainers on this bug that has been around for way too long now. Given that neither of:
- the very long comment
- the git commit history
- the tests
- my very dysfunctional brain
are of any help at understanding why relatedTarget was looked for in the first place, and given that it introduces a bug in the appendToBody={true} case, this is the most logical PR I could come up with.
By the way, a less controversial fix might be what I suggested here about a year ago.
This is happening in my project as well
Codecov Report
Merging #1890 (e34fc2f) into master (57cba2f) will increase coverage by
0.06%. The diff coverage is0.00%.
@@ Coverage Diff @@
## master #1890 +/- ##
==========================================
+ Coverage 79.99% 80.06% +0.06%
==========================================
Files 57 57
Lines 2299 2297 -2
Branches 638 636 -2
==========================================
Hits 1839 1839
+ Misses 271 269 -2
Partials 189 189
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/components/SingleDatePicker.jsx | 65.95% <0.00%> (+1.37%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 57cba2f...e34fc2f. Read the comment docs.