From 048af354d4cd2285f5fec70e05b652e2dae58f8c Mon Sep 17 00:00:00 2001 From: Parvin Sattorova Date: Sun, 22 Oct 2023 14:52:37 -0600 Subject: [PATCH] fix: Add solution to jumping transition to play video after implimenting the A11y scip-link --- src/Components/Homepage/Homepage.js | 16 ++++++++++++---- src/Components/Homepage/Homepage.scss | 13 ++++++++++++- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/Components/Homepage/Homepage.js b/src/Components/Homepage/Homepage.js index 60f816f..fb4d827 100644 --- a/src/Components/Homepage/Homepage.js +++ b/src/Components/Homepage/Homepage.js @@ -1,9 +1,17 @@ -import React, { useState } from 'react'; +import React, { useState, useRef } from 'react'; import refugeesImage from '../../images/refugees.png'; import '../Homepage/Homepage.scss'; function Homepage() { const [showVideo, setShowVideo] = useState(false); + const videoRef = useRef(null); + + const handlePlayVideo = () => { + setShowVideo(true); + setTimeout(() => { + videoRef.current.focus(); + }, 300); + }; return (
@@ -13,13 +21,13 @@ function Homepage() {
{showVideo ? ( -
+
@@ -54,7 +62,7 @@ function Homepage() {