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(mantine, tabledaterangepicker): close datepicker when clicking back on calendar button #3286

Merged
merged 7 commits into from
May 24, 2023

Conversation

aboissinot-coveo
Copy link
Contributor

@aboissinot-coveo aboissinot-coveo commented May 19, 2023

Proposed Changes

In the component TableDateRangePicker, when clicking on the calendar button, the date picker would open fine. However, when clicking again on the same button, the date picker would stay open instead of closing.

  • Modified the onClick handler of the button to pass an updater function to setOpened instead of true. That updater function receives the pending state and returns the opposite.
  • Fix a small typo (formatedRange => formattedRange)
  • Added some tests to make sure that the bug is covered and doesn't come back.
  • Fixed the vitest config to get rid of typings errors with react-testing-library matchers (based on this).

Component fix

before after
 
Screen.Recording.2023-05-19.at.11.37.03.AM.mov
Screen.Recording.2023-05-19.at.11.42.22.AM.mov

Typings fix

before after
 

Potential Breaking Changes

None.

Acceptance Criteria

  • The proposed changes are covered by unit tests
  • The potential breaking changes are clearly identified
  • README.md is adjusted to reflect the proposed changes (if relevant)

@github-actions
Copy link

github-actions bot commented May 19, 2023

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Manifest Files

@aboissinot-coveo aboissinot-coveo changed the title UI tool 8787/fix datepicker button fix(mantine, tabledaterangepicker): close datepicker when clicking back on calendar button May 19, 2023
@github-actions
Copy link

@aboissinot-coveo aboissinot-coveo marked this pull request as ready for review May 19, 2023 17:03
@aboissinot-coveo aboissinot-coveo requested review from a team, GermainBergeron and msrioux-coveo and removed request for a team May 19, 2023 17:03
Copy link
Contributor

@dmgauthier dmgauthier left a comment

Choose a reason for hiding this comment

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

GG

@aboissinot-coveo aboissinot-coveo merged commit 655c8cc into master May 24, 2023
@aboissinot-coveo aboissinot-coveo deleted the UITOOL-8787/fix-datepicker-button branch May 24, 2023 18:23
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.

3 participants