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 1818 scrollableContainer .scrollToBottom ();
1919 }
2020 }
21+
22+ // Export method to scroll to top
23+ export function scrollToTop() {
24+ if (scrollableContainer ?.scrollToTop ) {
25+ scrollableContainer .scrollToTop ();
26+ }
27+ }
2128 </script >
2229
2330<ScrollableContainer
Original file line number Diff line number Diff line change 2727
2828 let currentSelectedId = $state (selectedId || pages [0 ]?.id || ' ' );
2929 const currentPage = $derived (pages .find ((p ) => p .id === currentSelectedId ));
30+ let scrollableContainer: ConfigurableScrollableContainer ;
3031
3132 function selectPage(pageId : string ) {
3233 currentSelectedId = pageId ;
3334 onSelectPage (pageId );
3435 }
36+
37+ $effect (() => {
38+ if (currentSelectedId ) {
39+ scrollableContainer ?.scrollToTop ();
40+ }
41+ });
3542 </script >
3643
3744<div class =" modal-settings-wrapper" >
6471 </div >
6572
6673 <section class ="page-view" use:focusable ={{ vertical : true }}>
67- <ConfigurableScrollableContainer >
74+ <ConfigurableScrollableContainer bind:this ={ scrollableContainer } >
6875 <div class =" page-view__content" >
6976 {@render content ({ currentPage })}
7077 </div >
You can’t perform that action at this time.
0 commit comments