[Bug Fix] Accordion clips content that grows after opening - #500
Merged
djalmaaraujo merged 1 commit intoAug 5, 2026
Merged
Conversation
revealContent froze the panel at the height measured on open, so content that appears after opening (lazy-loaded iframes/images, expanding rows) was clipped. Release the height to `auto` once the open animation finishes, and collapse from the current rendered height since Motion can't interpolate from `auto`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pierry01
force-pushed
the
fix/accordion-height-auto-after-open
branch
from
August 5, 2026 14:35
aa50fed to
f374c23
Compare
djalmaaraujo
approved these changes
Aug 5, 2026
This was referenced Aug 5, 2026
Merged
djalmaaraujo
added a commit
that referenced
this pull request
Aug 5, 2026
Bump RubyUI to 1.6.0 (minor: new component + new component options since v1.5.0). - gem/lib/ruby_ui.rb → 1.6.0; regenerate gem/ and docs/ Gemfile.lock - docs home hero badge → headline features (InputOtp, Combobox placement) - rebuild mcp/data/registry.json Highlights since v1.5.0: - New component: InputOtp (#456) - Combobox: configurable popover placement (#480), CheckboxGroup reuse for required ComboboxCheckbox (#479) - DataTable: custom label + initial column visibility in DataTableColumnToggle (#466) - Popover: data-state/data-side, clear closeTimeout on disconnect, close on Escape (#495) - Accordion: no longer clips content that grows after opening (#500, #490) - Toast: toaster state initialized in initialize() so server-rendered toasts don't throw (#499) - Docs: Stimulus controllers symlinked to gem source, no more hand-copied drift (#493)
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.
Related issue
No existing issue — happy to open one if you'd prefer to track it separately.
Description
revealContent()measuresscrollHeightat open time and animates the panel to that fixed pixel height. The inline height then stays frozen, so any content that grows after the panel is already open — a lazy-loaded iframe/image, an async-rendered row, a nested control that expands — is clipped by the panel's fixed height +overflow.This fix makes the panel resilient to content that changes after opening:
revealContent()— once the open animation finishes (and the item is still open), release the fixed height back toheight: auto, so the panel tracks its content instead of freezing at the height measured on open.hideContent()— collapse from the element's current rendered height (getBoundingClientRect().height) via an explicit[from, "0px"]keyframe. Motion can't interpolate fromauto, so an explicit start is required now that the open state isauto. Using the current height (notscrollHeight) also avoids a jump-to-full-height on fast open→close toggles..catch(() => {})guards the newfinishedpromise onrevealContent(closing mid-open-animation rejects it).The open/close animation is visually unchanged — only the resting open state goes from a fixed pixel height to
auto. The existinghidden-attribute anddata-statebehavior is preserved.