Files
Jorge Manrubia 0f664a8ce1 Add create cards with keyboard
CTRL+ENTER to create
CTRL+SHIFT+ENTER to create and add another
2025-11-11 12:38:23 +01:00

16 lines
352 B
JavaScript

import { Controller } from "@hotwired/stimulus"
import { nextFrame } from "helpers/timing_helpers";
export default class extends Controller {
static targets = [ "clickable" ]
async click() {
await nextFrame()
this.#clickable.click()
}
get #clickable() {
return this.hasClickableTarget ? this.clickableTarget : this.element
}
}