fix: ensure height does not exceed initial height#4547
fix: ensure height does not exceed initial height#4547hieunm156 wants to merge 1 commit intoalpinejs:mainfrom
Conversation
PR Review: #4547 — fix: ensure height does not exceed initial heightType: Bug fix (debatable — this is arguably a behavior change) What's happening (plain English)The collapse plugin has a This PR addresses a scenario where the element's natural content height is shorter than the configured min-height. For example: content is 50px tall, but you set The actual functional change is a single line: Before: if (! el._x_isShown) el.style.height = `${floor}px`After: let initialHeight = el.getBoundingClientRect().height
if (!el._x_isShown) el.style.height = initialHeight < floor ? `${initialHeight}px` : `${floor}px`The rest of the diff (~90% of it) is cosmetic formatting changes: removing spaces after Other approaches considered
Changes MadeNo changes made. Test Results
Code ReviewIssues found:
SecurityNo security concerns identified. VerdictClose. Here's why:
If this behavior is actually desired, it would need to be implemented as a proper feature with:
Reviewed by Claude |
I have made some changes to ensure that the height does not exceed the initial height in the Alpine Collapse plugin.
This adjustment is based on personal user experience and #5739.
Thank you!