Yes, and I don't get any errors. But I can tell the if statement is not working the way I want. I mean without the if statement it's working properly but then I can't open the dropdown as it sets the aria expanded to false on all click when I want only after.
I have a few dropdown selection lists and want them to exit if you click anywhere on the site/document(make the aria-expanded false) because at the moment it exits only if you click on itself or one of the items inside the dropdown.
const selection =...