Skip to content

fix(annotation/vue): call onClick handler on link pointerdown#517

Merged
bobsingor merged 3 commits intoembedpdf:mainfrom
sebabal:fix/vue-link-annotation-click
Mar 17, 2026
Merged

fix(annotation/vue): call onClick handler on link pointerdown#517
bobsingor merged 3 commits intoembedpdf:mainfrom
sebabal:fix/vue-link-annotation-click

Conversation

@sebabal
Copy link
Contributor

@sebabal sebabal commented Mar 10, 2026

Summary

  • The Vue link annotation template @pointerdown="hasIRT ? undefined : onClick" compiles to ($event) => hasIRT ? void 0 : onClick, which returns the onClick function reference instead of calling it
  • This means clicking a link annotation in the Vue build never triggers selectOverride, so selectAnnotation is never called and link selection/navigation does not work
  • Fix: change to onClick?.($event) so Vue properly invokes the handler

The Preact/React builds are unaffected since JSX onPointerDown={onClick} directly assigns the handler reference.

The Vue template `@pointerdown="hasIRT ? undefined : onClick"` compiles
to `($event) => hasIRT ? void 0 : onClick`, which evaluates the onClick
function reference but never calls it. This means clicking a link
annotation in the Vue build never triggers selectOverride, so
selectAnnotation is never called and link selection does not work.

Change to `onClick?.($event)` so Vue compiles it to
`($event) => hasIRT ? void 0 : onClick?.($event)`, which properly
invokes the handler.

The Preact/React builds are unaffected as JSX `onPointerDown={onClick}`
directly assigns the handler reference.
@vercel
Copy link

vercel bot commented Mar 10, 2026

@sebabal is attempting to deploy a commit to the OpenBook Team on Vercel.

A member of the Team first needs to authorize it.

@bobsingor bobsingor merged commit 3b1c983 into embedpdf:main Mar 17, 2026
0 of 5 checks passed
@github-actions github-actions bot mentioned this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants