Fix click outside the image has no action issue

This commit is contained in:
Victor Zhao 2021-08-03 12:13:11 -07:00
parent 9e59f604e6
commit 2bcac507c8
No known key found for this signature in database
GPG Key ID: F34B36522E3C980F

View File

@ -10,6 +10,12 @@ ratingsContainer.addEventListener('click', (e) => {
e.target.parentNode.classList.add('active') e.target.parentNode.classList.add('active')
selectedRating = e.target.nextElementSibling.innerHTML selectedRating = e.target.nextElementSibling.innerHTML
} }
if(e.target.classList.contains('rating')) {
removeActive()
e.target.classList.add('active')
selectedRating = e.target.nextElementSibling.innerHTML
}
}) })
sendBtn.addEventListener('click', (e) => { sendBtn.addEventListener('click', (e) => {