fix(root): resize expanded code previews - #1887
sylvesterkaczmarek wants to merge 7 commits into
Conversation
|
Please can you rebase this pull request? |
2d243f8 to
37976be
Compare
|
Rebased onto the latest develop. Thanks! |
GCHQ-Developer-299
left a comment
There was a problem hiding this comment.
When tested locally the change works, however when you minimise the code preview it does not return to the correct size:
Screen.Recording.2026-08-27.at.11.44.17.mov
However, this change does seem to remedy #1844 (i've not had the Code Previews fail to appear while testing these changes)
…ag-announcement docs: explain status tag announcements
…cker-validation docs: clarify date picker validation
…igation-links fix(root): render secondary navigation items as links
37976be to
ce6fad2
Compare
|
Thanks for catching the collapse case. I’ve rebased this onto the current |
069fb2e to
3230dbf
Compare
Summary
Fix code preview height recalculation when users toggle Show full code and Show less code.
Problem
The code preview panels share an explicit synchronized height. After expanding a preview, reading
scrollHeightwhile that larger fixed height is still applied can preserve the expanded height when the preview is collapsed again.Fix
Temporarily reset both panel heights to
autobefore measuring their naturalscrollHeight, then restore the synchronized height using the fresh measurement. This preserves equal-height framework tabs while allowing both expansion and collapse to resize correctly.Verification
On the Date Picker code page, the first preview measures 58 px initially, expands to 666 px, and returns to 58 px after Show less code. Prettier, TypeScript, ESLint, Jest, and the full production build pass locally.
Closes #1845