-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adi- countries #9
base: main
Are you sure you want to change the base?
Conversation
.then(countries => { | ||
const template=document.querySelector(".country[data-country-name]") | ||
const grid=document.querySelector(".countries-grid"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure template
and grid
are not null
dropdownItems.forEach(item => { | ||
item.addEventListener("click", (event) => { | ||
const region = event.target.getAttribute("data-region"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if data-region
is missing before proceeding.
if (!region) return;
dropdownWrapper.classList.toggle("open"); | ||
}); | ||
|
||
document.addEventListener("click",(event)=>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a check to ensure dropdownWrapper
and dropdownHeader
exist to avoid potential errors if they are not present in the DOM
No description provided.