Skip to content

Commit

Permalink
Element inside anchor can have different click event
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Apr 3, 2024
1 parent 146dea1 commit 270ceb1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/web/controls/AtomControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,10 +685,11 @@ window.addEventListener("click", (e) => {

const originalTarget = e.target as HTMLElement;
let start = originalTarget;
let clickEvent;
while (start) {
clickEvent ||= start.getAttribute("data-click-event");
if (start.tagName === "A") {
const clickEvent = start.getAttribute("data-click-event");
if(clickEvent === null) {
if(!clickEvent) {
// let default handler run here
// get href...
return;
Expand Down

0 comments on commit 270ceb1

Please sign in to comment.