From d76e40b5f8fc5b69b024a7f9acb5cf1a86fb364d Mon Sep 17 00:00:00 2001 From: tramirez30 Date: Tue, 17 Dec 2024 21:18:27 -0800 Subject: [PATCH] Moving optionSelected function into isActive if logic --- js/main.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index 69780ed..4ad9da1 100644 --- a/js/main.js +++ b/js/main.js @@ -118,16 +118,15 @@ let isActive = (e) => { dropDown.classList.toggle("is-active"); icon.classList = "fas fa-angle-up"; } else { + optionSelected(); closeDropdown(); } - optionSelected(); }; // Option function selected let optionSelected = (e) => { if (option.contains(e.target)) { - dropDown.classList.remove("is-active"); icon.classList = "fas fa-angle-down"; } };