Links with hx-get and ctrl+click #1121
Unanswered
jcrawfordor
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a link, using a plain old with an href attribute. I've added an hx-get targeting another element to implement a "lightbox"-like modal view. Clicking on the link to open the viewer works, and right-clicking it and clicking "Open in new tab" works. But, ctrl+click on the link to open a new tab does not.
Originally, ctrl+click caused the viewer to open. In an effort to fix this I put a !ctrlKey filter on the hx-trigger, but now ctrl+click on the link simply does nothing... I suspect HTMX has still put a handler on the link that prevents the browser handling clicks. What I have looks like this:
Any ideas on how I might be able to keep normal ctrl+click behavior with this setup? I assume middle-click also doesn't function the way I want but, well, I don't have a middle mouse button handy.
Beta Was this translation helpful? Give feedback.
All reactions