Sha256: 633491f9957c0e5d77ac32deaebcb4aaaeda98b1eeb184393cc4ccfac692adf4
Contents?: true
Size: 432 Bytes
Versions: 2
Compression:
Stored size: 432 Bytes
Contents
import { Controller } from "stimulus"; export default class extends Controller { static targets = ["field"]; clear(){ this.eventTarget.value = null; window.dispatchEvent(new CustomEvent('search-controller:submit', {})) } submit(event) { event.preventDefault(); if (event.key === 'Enter' || event.type === 'click') { window.dispatchEvent(new CustomEvent('search-controller:submit', {})) } } }
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rails_mini_profiler-0.5.0 | app/javascript/js/search_controller.js |
rails_mini_profiler-0 | app/javascript/js/search_controller.js |