Repository navigation
Conversation
|
Hey @kineticjs, Thanks for picking this up. As this bug fix is quite important for our team's CI pipeline I also took a look at your PR. It does not fix the resize case though. If the width is changed to 696px afterwards (from 640 or from 760), the message flips between scene and dialog forever, about 30 times per second. No error anymore, but it never settles. This is our case in the Kyma dashboard, where the message sits in a column that is being resized. What fixed it for me: in if (oldMedia === this.media) {
const w = this.offsetWidth, h = this.offsetHeight;
if (!this._ongoingMediaChange.some(s => s.width === w && s.height === h)) {
this._ongoingMediaChange = [];
}
} |
This branch has not been deployed
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.
Fixes: #14125
Problem:
With design="Auto" inside a scrollable container whose width sits just
above the scene/dialog breakpoint (681px), media oscillates endlessly: "scene"
grows the content, a scrollbar appears and steals ~15px of width, so media drops
to "dialog"; the shorter content removes the scrollbar, width grows back, and
"scene" is selected again — forever.
Findings:
Since the scrollbar that appears on resize does not belong to the Illustrated Message
nor to its direct parent container (both do not overflow and the scrollbar comes from
an upper-level container) we cannot directly detect a cause-and-effect relationship
between media change and the further resize that follows.
Thus, the only way to detect it is to monitor the effect of media changes:
We observe if:
Solution in more detail:
height} fingerprints. When applying a media would reproduce the step before the
last (an A->B->A circle), settle on the currently applied media instead of
changing it.
change on resize or after rendering), so a later genuine resize is never
mistaken for a continuation of the cycle.