Autofocus join call button when ready
This commit is contained in:
parent
9c3e4907c8
commit
ec447429c5
1 changed files with 10 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect, useRef } from "react";
|
||||||
import styles from "./LobbyView.module.css";
|
import styles from "./LobbyView.module.css";
|
||||||
import { Button, CopyButton, MicButton, VideoButton } from "../button";
|
import { Button, CopyButton, MicButton, VideoButton } from "../button";
|
||||||
import { Header, LeftNav, RightNav, RoomHeaderInfo } from "../Header";
|
import { Header, LeftNav, RightNav, RoomHeaderInfo } from "../Header";
|
||||||
|
@ -43,6 +43,14 @@ export function LobbyView({
|
||||||
|
|
||||||
useLocationNavigation(state === GroupCallState.InitializingLocalCallFeed);
|
useLocationNavigation(state === GroupCallState.InitializingLocalCallFeed);
|
||||||
|
|
||||||
|
const joinCallButtonRef = useRef();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (state === GroupCallState.LocalCallFeedInitialized) {
|
||||||
|
joinCallButtonRef.current.focus();
|
||||||
|
}
|
||||||
|
}, [state]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.room}>
|
<div className={styles.room}>
|
||||||
<Header>
|
<Header>
|
||||||
|
@ -103,6 +111,7 @@ export function LobbyView({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
|
ref={joinCallButtonRef}
|
||||||
className={styles.copyButton}
|
className={styles.copyButton}
|
||||||
size="lg"
|
size="lg"
|
||||||
disabled={state !== GroupCallState.LocalCallFeedInitialized}
|
disabled={state !== GroupCallState.LocalCallFeedInitialized}
|
||||||
|
|
Loading…
Add table
Reference in a new issue