File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
desktop-app/src/renderer/components/Previewer/Device Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -138,9 +138,18 @@ const Toolbar = ({
138138 onRotate ( ! rotated ) ;
139139 } ;
140140
141+ const scrollToTop = ( ) => {
142+ if ( webview ) {
143+ webview . executeJavaScript (
144+ 'window.scrollTo({ top: 0, behavior: "smooth" })' ,
145+ false
146+ ) ;
147+ }
148+ } ;
149+
141150 return (
142151 < div className = "flex items-center justify-between gap-1" >
143- < div className = "my-1 inline-flex max-w-[75 %] items-center gap-1 overflow-x-auto" >
152+ < div className = "my-1 inline-flex max-w-[78 %] items-center gap-1 overflow-x-auto" >
144153 < Button onClick = { refreshView } title = "Refresh This View" >
145154 < Icon icon = "ic:round-refresh" />
146155 </ Button >
@@ -187,6 +196,9 @@ const Toolbar = ({
187196 }
188197 />
189198 </ Button >
199+ < Button onClick = { scrollToTop } title = "Scroll to Top" >
200+ < Icon icon = "ic:baseline-arrow-upward" />
201+ </ Button >
190202 < Button onClick = { toggleRulers } title = "Show rulers" >
191203 < Icon icon = "tdesign:measurement-1" />
192204 </ Button >
You can’t perform that action at this time.
0 commit comments