Skip to content

Commit 2918e1c

Browse files
authoredJan 3, 2025
Update 2023-09-01-stimulusjs-hotkeys.md
1 parent 552452e commit 2918e1c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎_posts/2023-09-01-stimulusjs-hotkeys.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ rails g stimulus click
3232
import { Controller } from "@hotwired/stimulus"
3333

3434
export default class extends Controller {
35-
click() {
35+
click(event) {
36+
const formElements = ['INPUT', 'TEXTAREA', 'SELECT']
37+
if (formElements.includes(event.target.tagName)) {
38+
return
39+
}
3640
this.element.click()
3741
}
3842
}

0 commit comments

Comments
 (0)