Prevent default when handling keyboard shortcuts

Without this, any default action would still happen. With Chrome on
Linux, that causes browser features to be triggered with our CTRL+J and
CTRL+K actions.
This commit is contained in:
Kevin McConnell
2025-05-28 08:18:49 +01:00
parent 75b7935185
commit 880e3d98b2
2 changed files with 2 additions and 2 deletions
@@ -3,6 +3,7 @@ import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
click(event) {
if (this.#isClickable && !this.#shouldIgnore(event)) {
event.preventDefault()
this.element.click()
}
}