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 = [];
}
} |
|
Hi @chriskari , Thank you very much for the prompt feedback and the help to trace the issue! |
|
Hey @kineticjs, Best, |
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.