Fix modifier-key click guard in orchestration verb handler

The set!-based approach (nested when + mutate + re-check) didn't work
because CEK evaluates the outer when condition once. Replace with a
single (when (and should-fire (not modifier-click?)) ...) guard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 10:17:18 +00:00
parent 0c7567925e
commit 89543e0152
2 changed files with 7 additions and 10 deletions

View File

@@ -415,12 +415,9 @@
(set! should-fire false)
(set! last-val val))))
(when should-fire
;; Let browser handle modifier-key clicks (ctrl-click → new tab)
(when (and (= event-name "click") (event-modifier-key? e))
(set! should-fire false))
(when should-fire
;; Let browser handle modifier-key clicks (ctrl-click → new tab)
(when (and should-fire
(not (and (= event-name "click") (event-modifier-key? e))))
;; Prevent default for submit/click on links
(when (or (= event-name "submit")
(and (= event-name "click")
@@ -453,7 +450,7 @@
(set-timeout
(fn () (execute-request el nil nil))
(get mods "delay"))))
(execute-request el nil nil)))))))))
(execute-request el nil nil))))))))
(if (get mods "once") (dict "once" true) nil))))))