This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
fix: make sure to create picker before calling update #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
.update()
before the date picker is created was causing the input to be override as the new picker element and was also causing leakage when clicking the input because at that point 2 elements were now assigned as the picker container (input & new picker in the body)createCalendarToInput
as a separate and exported function so that we can call it at the start of the.update()
if the picker hasn't been created yet.cleanup
thing, if we create the picker outside of thehandleInput
, then we don't have access to that cleanup array, however I couldn't find how this cleanup is being called, so it might ok to leave itbelow is the bug that was found, you can see the input being reassigned as the new picker (and the correct picker is not being created in the body because it thinks the input is the picker)
bug
ref codesandbox
after fix
now we can see that when we click the set date button, it will initialize (create) the picker in body and leave the input untouched as it should be