Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Avoid empty onchange event in Date Range #162

Merged

Conversation

chepelevdi
Copy link
Collaborator

@chepelevdi chepelevdi commented Aug 18, 2022

Hey.

The problem in Date Range is that it fires onChange callback after first render with empty data, but it should fires it only after confirm the calendar. That is why users of the component have to use a lot of additional ifelse checks.

My code prevents first invoke of onChange, and this resolves all issues.

@chepelevdi chepelevdi requested review from a team as code owners August 18, 2022 10:23
@juliewongbandue
Copy link
Collaborator

juliewongbandue commented Aug 18, 2022

This makes sense to me. I did a quick search in Vimeo/vimeo and it looks like the other places that this is used would benefit from this change as well. Though unlikely, I am still slightly concerned that there might be somewhere else this is implemented where the onChange is expected to be called on first render. We should definitely test this thoroughly before upgrading in the platform.

@juliewongbandue juliewongbandue merged commit c91967c into vimeo:main Aug 18, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants