Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Mostly doing this here to force GitHub to recheck the branch (it has broken checks right now that I can't re-trigger)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue number: resolves #31155, resolves #31143
What is the current behavior?
Currently, an
ion-datetimeinside a modal or popover shows the wrong month once the overlay is reopened. The selected day isn't visible, the previous month button does nothing, and picking a day from the grid lands on an unrelated date.Overlays move their host element into
ion-appwhen presenting and back to its original position when dismissing, which disconnects and reconnects the datetime.disconnectedCallbackresethasBeenIntersectingduring that move, so by the time the hidden-stateIntersectionObserverentry arrived,hiddenCallbackmistook the dismissal for the synthetic initial entry and returned early. That leftdatetime-readyon the host, so on the next presentmarkReadysaw the class and returned without re-centering the calendar on the working month, and the browser had already resetscrollLeftto 0 while the overlay was hidden.scrollLeft: 0renders the previous month's grid while the header still names the working month, which is what produces all three symptoms.What is the new behavior?
With this change,
disconnectedCallbackno longer resetshasBeenIntersecting. That flag tracks the observers, and the observers are only created incomponentDidLoadand never re-created on reconnect, so a DOM move has no business clearing it.hiddenCallbacknow sees the real hidden transition on dismiss and tears down as it did before #31108, which letsmarkReadyrun again on the next present and re-center the calendar.Does this introduce a breaking change?
Other information
This regression was introduced in #31108. That PR needed the flag to make
hiddenCallbackignore the synthetic initial entry, but thedisconnectedCallbackreset it also added had no job and broke the overlay case. Before #31108,hiddenCallbackhad no guard at all and always removeddatetime-readyon dismiss, so this restores the behavior that shipped for all of v8..To reproduce: open the "Modal - Default" picker, dismiss it, then open it again. On
mainthe grid shows February while the header reads March 2022.