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 condition preventing props.onFocus execution #5315

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

dshster
Copy link

@dshster dshster commented Jan 13, 2025

Fixing the prevention of executing props.onFocus after the visibilitychange event occurs.


Problem
In MR #4878, the behavior of the calendar popup when switching browser tabs has been fixed. However, the props.onFocus callback in the handleFocus method was blocked if a browser tab was switched before.

Changes
I've moved the isOpenAllowed flag condition checking so that the props.onFocus callback will execute as before, regardless of the calendar popup opening.

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.

@dshster 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

+ 32
- 2

76% TSX (tests)
24% TSX

Type of change

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

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.

The change looks good and matches the description

Image of Xiaoyong W Xiaoyong W


Reviewed with ❤️ by PullRequest

@martijnrusschen
Copy link
Member

Please check the output of https://github.com/Hacker0x01/react-datepicker/actions/runs/12751165481/job/35545719040?pr=5315. Seems there's a little formatting issue.

@dshster dshster force-pushed the fix-disallowed-onfocus branch from e615a1e to 1285af4 Compare January 14, 2025 07:22
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.92%. Comparing base (6c6e8d4) to head (1285af4).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5315   +/-   ##
=======================================
  Coverage   96.92%   96.92%           
=======================================
  Files          30       30           
  Lines        3413     3416    +3     
  Branches     1425     1427    +2     
=======================================
+ Hits         3308     3311    +3     
  Misses        103      103           
  Partials        2        2           

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

@martijnrusschen martijnrusschen merged commit 3c4d860 into Hacker0x01:main Jan 14, 2025
6 checks passed
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