Skip to content

Commit

Permalink
[FIX] Not scroll back to top after review (st3v3nmw#971)
Browse files Browse the repository at this point in the history
* Update deprecated function

* Add scroll back to top

* Fix linting
  • Loading branch information
4Source authored and KyleKlus committed Jul 22, 2024
1 parent daf9cd9 commit 1fb55ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/gui/FlashcardReviewView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ export class FlashcardReviewView {
this._currentNote.filePath,
);
await wrapper.renderMarkdownWrapper(this._currentCard.front, this.content);
// Set scroll position back to top
this.content.scrollTop = 0;

// Setup response buttons
this._resetResponseButtons();
Expand Down
2 changes: 1 addition & 1 deletion src/util/RenderMarkdownWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class RenderMarkdownWrapper {
): Promise<void> {
if (recursiveDepth > 4) return;

MarkdownRenderer.renderMarkdown(markdownString, containerEl, this.notePath, this.plugin);
MarkdownRenderer.render(this.app, markdownString, containerEl, this.notePath, this.plugin);

containerEl.findAll(".internal-embed").forEach((el) => {
const link = this.parseLink(el.getAttribute("src"));
Expand Down

0 comments on commit 1fb55ae

Please sign in to comment.