Sha256: 3c5fd15807413280d2c0242f8765e074515a7220eff1589bb6984e558817add7
Contents?: true
Size: 394 Bytes
Versions: 7
Compression:
Stored size: 394 Bytes
Contents
import { Controller } from "@hotwired/stimulus" export default class extends Controller { click(event) { if (this.#isClickable && !this.#shouldIgnore(event)) this.element.click() } #shouldIgnore(event) { return event.defaultPrevented || event.target.closest("input, textarea") } get #isClickable() { return getComputedStyle(this.element).pointerEvents !== "none" } }
Version data entries
7 entries across 7 versions & 1 rubygems