0f664a8ce1
CTRL+ENTER to create CTRL+SHIFT+ENTER to create and add another
16 lines
352 B
JavaScript
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
|
|
}
|
|
}
|