Skip to content

Commit

Permalink
Blur on Page update
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyEJohnson committed Aug 13, 2024
1 parent 932e780 commit 744d8ee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/content/components/Page/PageComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ export default class PageComponent extends Component<PagePropTypes> {
// per rerender. componentDidUpdate is called multiple times when user navigates quickly.
const runId = this.getRunId();

this.doFocus = true;
// If page has changed, call postProcess that will remove old and attach new listerns and start mathjax typesetting.
// If page has changed, call postProcess that will remove old and attach new listeners and start mathjax typesetting.
if (prevProps.page !== this.props.page) {
const activeEl = document?.activeElement;

this.doFocus = true;
(activeEl as HTMLElement).blur();
this.postProcess();
}

Expand Down

0 comments on commit 744d8ee

Please sign in to comment.