fix(datetime): wheel picker shows consistently in overlays #29147
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 #26234
What is the current behavior?
We use an IntersectionObserver to know when each picker column is visible so we can properly scroll the active option in each column into view. The IO callback passes an array of entries. Up until this PR, we have always grabbed the first entry in the array. The problem is that browsers will sometimes group multiple events into a single array. This means it's possible to have an event with
isIntersecting: false
and then another event withisIntersecting: true
in the same callback. Since we always grabbed the first event we did not account for the instances where events were coalesced.This resulted in column options sometimes not scrolling into view when presented via an overlay.
What is the new behavior?
Does this introduce a breaking change?
Other information
Dev build:
7.7.5-dev.11710347256.1954cae9