Repository navigation
fix: keep a growing popup from flashing a scroll bar - #884
Conversation
A popup gets its new content height at once, then animates its own height to match, so for the length of the animation its scroll view is shorter than its content and shows a scroll bar. Opening the Sound popup's outputs and switching to a taller view both did it. A popup now records whether it is as tall as its content. While it is, its scroll view shows no scroll bar, since there is nothing to scroll; a popup taller than the screen allows keeps its scroll bar, and scroll views inside its blocks keep theirs. Fixes #883
Before and after
261 unchanged screens
Visual review: 261 screens, none changed. |
|
🎉 This PR is included in version 0.19.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Problem
When a popup's content grows while it's open, a scroll bar flashes on it until its height catches up, although everything fits. Showing the outputs in the Sound popup does it every time, and so does switching a popup to a taller view.
Fixes #883
Changes
A popup gets its new content height at once, then animates its own height to match (
WidgetPopup.resize). For the length of that animation, theScrollViewinPopupViewis shorter than its content, so it shows a scroll bar.PopupSizerecords whether the popup is as tall as its content (followsContent).WidgetPopupsets it where it already compares the content's height with the most the screen allows, before it resizes.PopupView's scroll view shows no scroll bar (.scrollIndicators(.never)), since it has nothing to scroll. A popup taller than the screen allows, a popup with a fixedheightand the app menu's submenus keep their scroll bars. Content inside resets to.automatic, so scroll views inside blocks keep theirs.Testing
swift test --filter "PresentationIntegrationTests|PopupClickTests|PopupSpacingTests|EndStopSliderTests|FilledSliderTests|MixerStateTests|SceneRendererTests": 98 tests passed.scripts/check.sh --quickpassed.Merging
One commit: any merge method works, and a squash keeps the same message.
Claude Opus 5.5 via Claude Code