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: popper dosen't close if swapRange prop was passed #4689

Merged

Conversation

mirus-ua
Copy link
Contributor


name: Fix input behavior
about: input doesn't close popper if swapRange prop passed

Problem
After the 6.7.0 release, I found that the new swapRange feature doesn't allow to close datepicker popper automatically when the range selected in reverse order

Changes
Add swapRange into the related check + a new test case

Screenshots

The first video is before the fix

2024-04-15.11.42.47.mov

The second one is after the fix

2024-04-15.11.44.25.mov

Contribution checklist

  • I have followed the contributing guidelines.
  • I have added sufficient test coverage for my changes.
  • I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ This pull request was sent to the PullRequest network for review. Expert reviewers are now being matched to your request based on the code's requirements. Stay tuned!

What to expect from this code review:
  • Comments posted to any areas of potential concern or improvement.
  • Detailed feedback or actions needed to resolve issues that are found.
  • Turnaround times vary, but we aim to be swift.

@mirus-ua you can click here to see the review status or cancel the code review job.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PullRequest Breakdown

Reviewable lines of change

+ 24
- 1

76% JavaScript (tests)
24% JavaScript

Type of change

Fix - These changes are likely to be fixing a bug or issue.

Copy link

codecov bot commented Apr 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.00%. Comparing base (0d2765f) to head (b9a83df).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4689   +/-   ##
=======================================
  Coverage   97.00%   97.00%           
=======================================
  Files          28       28           
  Lines        2638     2641    +3     
  Branches     1116     1136   +20     
=======================================
+ Hits         2559     2562    +3     
  Misses         79       79           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mirus-ua
Copy link
Contributor Author

related PR #4654

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these changes to be correct, but I question if the provided test already passes without the changes? It is not necessary to choose a different end date to exercise the new code?

Image of Graham C Graham C


Reviewed with ❤️ by PullRequest

@mirus-ua
Copy link
Contributor Author

I believe these changes to be correct, but I question if the provided test already passes without the changes? It is not necessary to choose a different end date to exercise the new code?

Image of Graham C Graham C

Reviewed with ❤️ by PullRequest

The original code swaps the dates on the final check and doesn't provide a possibility of handling[null, endDate] state
https://github.com/Hacker0x01/react-datepicker/pull/4654/files#diff-ec767e14d91498b5b31a4ce826c4596061eb83a47d3dee00f6cbe1078232a75cR697

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these changes to be correct, but I question if the provided test already passes without the changes? It is not necessary to choose a different end date to exercise the new code?

Reviewed with ❤️ by PullRequest

The original code swaps the dates on the final check and doesn't provide a possibility of handling[null, endDate] state
https://github.com/Hacker0x01/react-datepicker/pull/4654/files#diff-ec767e14d91498b5b31a4ce826c4596061eb83a47d3dee00f6cbe1078232a75cR697

OK, got it. 👍

Image of Graham C Graham C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants