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:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user