Skip to content

Commit

Permalink
Needed for old Page
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyEJohnson committed Nov 14, 2024
1 parent a39ed17 commit 4a9e6e7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Document } from '@openstax/types/lib.dom';
import React, { Ref } from 'react';
import { getType } from 'typesafe-actions';
import { ApplicationError, ToastMesssageError } from '../helpers/applicationMessageError';
Expand Down Expand Up @@ -122,6 +123,14 @@ export const getAllRegexMatches = (regex: RegExp) => {
};
};

export const resetTabIndex = (document: Document) => {
const index = document.body.tabIndex;
document.body.tabIndex = 0;

document.body.focus();
document.body.tabIndex = index;
};

export const preventDefault = (event: React.MouseEvent) => {
event.preventDefault();
return event;
Expand Down

0 comments on commit 4a9e6e7

Please sign in to comment.