Skip to content

Commit

Permalink
Reset scroll position
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Jul 21, 2024
1 parent ba9f6cf commit 181eaa5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/fontra/views/editor/panel-related-glyphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ export default class RelatedGlyphPanel extends Panel {
}
element.innerHTML = "";
element.appendChild(documentFragment);

// At least in Chrome, we need to reset the scroll position, but it doesn't
// work if we do it right away, only after the next event iteration.
setTimeout(() => {
element.scrollTop = 0;
}, 0);

hideAccordionItem = false;
} else {
element.innerHTML = "";
Expand Down

0 comments on commit 181eaa5

Please sign in to comment.