(e)
| 192 | const carousel = document.querySelector(".hero-carousel"); |
| 193 | if (carousel) { |
| 194 | const handleKeydown = (e) => { |
| 195 | if (document.activeElement === document.body || carousel.contains(document.activeElement)) { |
| 196 | if (e.key === "ArrowLeft") { |
| 197 | e.preventDefault(); |
| 198 | prevSlide(); |
| 199 | stopAutoPlay(); |
| 200 | startAutoPlay(); |
| 201 | } else if (e.key === "ArrowRight") { |
| 202 | e.preventDefault(); |
| 203 | nextSlide(); |
| 204 | stopAutoPlay(); |
| 205 | startAutoPlay(); |
| 206 | } |
| 207 | } |
| 208 | }; |
| 209 | |
| 210 | document.addEventListener("keydown", handleKeydown); |
| 211 | } |
nothing calls this directly
no test coverage detected