File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
apps/desktop/src/components Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 73
73
let headerHeight = $state (0 );
74
74
let contentHeight = $state (0 );
75
75
const totalHeightRem = $derived (pxToRem (headerHeight + contentHeight , zoom ));
76
+
77
+ let resizerInstance = $state <Resizer >();
78
+ $effect (() => {
79
+ // Reset resizer if we happen on a value that equals the scroll
80
+ // height, enabling the user to more easily undo manual sizing. It
81
+ // is assumed that an unset value makes the element display in
82
+ // full, otherwise there would be sudden content shift.
83
+ if (clientHeight === headerHeight + contentHeight ) {
84
+ requestAnimationFrame (() => {
85
+ resizerInstance ?.setValue (undefined );
86
+ });
87
+ }
88
+ });
76
89
</script >
77
90
78
91
<div
155
168
{/if }
156
169
{#if resizer }
157
170
<Resizer
171
+ bind:this ={resizerInstance }
158
172
defaultValue ={undefined }
159
173
viewport ={containerDiv }
160
174
hidden ={$collapsed }
Original file line number Diff line number Diff line change 243
243
return pxToRem (viewport .clientHeight , zoom );
244
244
}
245
245
246
- function setValue(newSize ? : number ) {
246
+ export function setValue(newSize ? : number ) {
247
247
value .set (newSize );
248
248
updateDom (newSize );
249
249
if (newSize !== undefined ) {
You can’t perform that action at this time.
0 commit comments