Were I can find info about all data-actions avaible?


#1

I know that in the ‘data-action’ attrib are avaible: click, submit, change

But is there avaible methods like onKeyPress?


#2

You can handle any DOM event with a Stimulus action. Here’s the HTML for a text input with a keypress action:

<input type="text" data-action="keypress->foo#bar">

The value of the input element’s data-action attribute tells Stimulus to handle keypress events for the input by invoking the bar method in the foo controller. Read more about action descriptors in the Handbook.