mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-01 01:59:56 +00:00
Fix jump to content (#2729)
This commit is contained in:
parent
7be8d1d8eb
commit
8a500f3ddf
1 changed files with 4 additions and 2 deletions
|
@ -16,13 +16,15 @@ import AnonymousGuard from "../common/anonymous-guard";
|
|||
import AdultConsentModal from "../common/modal/adult-consent-modal";
|
||||
import { destroyTippy, setupTippy } from "../../tippy";
|
||||
|
||||
function handleJumpToContent(event) {
|
||||
function handleJumpToContent(app: App, event: any) {
|
||||
event.preventDefault();
|
||||
app.contentRef.current?.focus();
|
||||
}
|
||||
|
||||
export default class App extends Component<any, any> {
|
||||
private isoData: IsoDataOptionalSite = setIsoData(this.context);
|
||||
private readonly rootRef = createRef<HTMLDivElement>();
|
||||
readonly contentRef = createRef<HTMLDivElement>();
|
||||
|
||||
componentDidMount() {
|
||||
setupTippy(this.rootRef);
|
||||
|
@ -69,7 +71,7 @@ export default class App extends Component<any, any> {
|
|||
|
||||
return (
|
||||
<ErrorGuard>
|
||||
<div tabIndex={-1}>
|
||||
<div tabIndex={-1} ref={this.contentRef}>
|
||||
{RouteComponent &&
|
||||
(isAuthPath(path ?? "") ? (
|
||||
<AuthGuard {...routeProps}>
|
||||
|
|
Loading…
Reference in a new issue