Fixes event propogation

This commit is contained in:
Mouse Reeve 2021-08-17 08:45:10 -07:00
parent b991510c03
commit 2f93017eaa

View file

@ -138,7 +138,9 @@ let BookWyrm = new class {
* @return {undefined} * @return {undefined}
*/ */
toggleAction(event) { toggleAction(event) {
event.preventDefault(); if (event.currentTarget == event.target) {
event.preventDefault();
}
let trigger = event.currentTarget; let trigger = event.currentTarget;
let pressed = trigger.getAttribute('aria-pressed') === 'false'; let pressed = trigger.getAttribute('aria-pressed') === 'false';
let targetId = trigger.dataset.controls; let targetId = trigger.dataset.controls;