Skip to content

Commit

Permalink
Limit touch click detection to the content div (#1402)
Browse files Browse the repository at this point in the history
  • Loading branch information
BentiGorlich authored Jan 31, 2025
1 parent bd79fa6 commit aec3229
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/controllers/subject_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class extends Controller {

// if in a list and the click is made via touch, open the post
if (!this.element.classList.contains('isSingle')) {
this.element.addEventListener('click', (e) => {
this.element.querySelector('.content').addEventListener('click', (e) => {
if (e.defaultPrevented) {
return
}
Expand Down Expand Up @@ -423,6 +423,7 @@ export default class extends Controller {
e.target.previousSibling.scrollIntoView();
this.isExpandedValue = false;
}
e.preventDefault();
});
}

Expand Down

0 comments on commit aec3229

Please sign in to comment.