Skip to content

Commit

Permalink
fix: always jump to top of page on page scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiksta committed Aug 30, 2024
1 parent 1c9922f commit c087694
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/renderer/common/tab-bar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { rx, h, Component, style, TemplateElementChild } from '@mvuijs/core';
import * as ui5 from '@mvuijs/ui5';
import { theme } from 'global-styles';
import { debounce } from 'lodash';

const DROP_INDICATOR_WIDTH = '.2em';
Expand Down Expand Up @@ -407,6 +408,7 @@ export class TabBar extends Component<{
':host': {
display: 'flex',
flexDirection: 'column',
background: theme.documentBackground,
},
'#tabbar': {
background: ui5.Theme.Button_Background,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/wournal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ export default class Wournal extends Component {
const pagePos = pages[page].display.getBoundingClientRect();
const viewport = this.currDocDisplay.document.getBoundingClientRect();

if (SVGUtils.rectIntersect(viewport, pagePos)) return;
// if (SVGUtils.rectIntersect(viewport, pagePos)) return;
const pagePosInViewPort = pagePos.top - viewport.top;
this.api.scrollPos(prevScrollPos.top + pagePosInViewPort, prevScrollPos.left);
},
Expand Down

0 comments on commit c087694

Please sign in to comment.