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(calendar): stop extra call to validation when choosing from picker #1623

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

kabaros
Copy link
Collaborator

@kabaros kabaros commented Oct 25, 2024

Fixes a bug when using the day picker (rather than manual entry) where the blur handler causes an extra call to onDateSelect with undefined, causing a flicker in the consumer.

This also addresses an issue with "clear" functionality to allow consumers to clear an input regardless of validation rules if it's clearable - this should also be updated here to not throw an error on empty dates, but for now, it's handled in the component and will follow up with a PR for multi-calendar-dates after discussing the default behaviour.

The PR also adds some unit tests for the various validation states.

@kabaros kabaros requested a review from a team as a code owner October 25, 2024 07:30
@dhis2-bot
Copy link
Contributor

🚀 Deployed on https://pr-1623--dhis2-ui.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify October 25, 2024 07:33 Inactive
Copy link
Member

@alaa-yahia alaa-yahia left a comment

Choose a reason for hiding this comment

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

LGTM!

@kabaros kabaros merged commit a1786d5 into alpha Oct 29, 2024
16 checks passed
@kabaros kabaros deleted the fix/calendar-validation-extra-call branch October 29, 2024 11:41
dhis2-bot added a commit that referenced this pull request Oct 29, 2024
# [10.0.0-alpha.6](v10.0.0-alpha.5...v10.0.0-alpha.6) (2024-10-29)

### Bug Fixes

* **calendar:** stop extra call to validation when choosing from picker ([#1623](#1623)) ([a1786d5](a1786d5))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 10.0.0-alpha.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

dhis2-bot added a commit that referenced this pull request Nov 21, 2024
# [10.0.0](v9.15.0...v10.0.0) (2024-11-21)

### Bug Fixes

* update calendar tests for react 18 ([98831a7](98831a7))
* update testing-library for selector-bar ([893024d](893024d))
* **calendar:** fix minor type issues ([#1588](#1588)) ([21e60a6](21e60a6))
* **calendar:** stop extra call to validation when choosing from picker ([#1623](#1623)) ([a1786d5](a1786d5))
* **calendar-input:** trigger onFocus if passed ([#1622](#1622)) ([293505d](293505d))
* bump multi calendar library version in calendar ([#1566](#1566)) ([d205016](d205016))
* bump multi calendar library version in calendar component  ([#1576](#1576)) ([5f2b13d](5f2b13d))
* bump multi-calendar library ([#1615](#1615)) ([238de1f](238de1f))
* bump multi-calendar library ([#1618](#1618)) ([769c7ae](769c7ae))
* clear button and arrow alignment issues ([#1609](#1609)) ([ba0b657](ba0b657))
* stories for calendar validation ([#1616](#1616)) ([c00a2d6](c00a2d6))
* update multi-calendar library ([6aa01cc](6aa01cc))
* update yarn.lock after deduping ([5c24b02](5c24b02))

### Features

* add aria attributes to loaders ([#1449](#1449)) ([2832584](2832584))
* calendar input to work with react final form ([827c3f8](827c3f8))
* memorize calendar container component to improve perfromance ([#1575](#1575)) ([0d00a19](0d00a19))
* merge branch master into branch ([0577074](0577074))
* merge master into alpha ([7afecf9](7afecf9))
* splitButton accessibility improvements ([#1458](#1458)) ([51a1b14](51a1b14))
* support editable input | min & max dates | dd-mm-yyyy format in CalendarInput ([#1504](#1504)) ([99a78f5](99a78f5))
* use alpha of multi calendar library ([0c6b966](0c6b966))
* verify date input only on blur on calendar input, close calendar popup on blur as well ([d8b0d1c](d8b0d1c))
* **tooltip:** accessibility improvements for tooltip ([#1463](#1463)) ([f11eabb](f11eabb))

### Reverts

* Revert "feat(selectionBar): accessibility improvements for SelectionBar (#1475)" ([54498fb](54498fb)), closes [#1475](#1475)

### BREAKING CHANGES

* multi-calendar hook no longer returns Temporal date

* fix: failing test
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 10.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants