Hotwire Discussion

How can an element respond to multiple events

Say I want an li to respond to dragstart and drop events. I want to be able to do something like:

<li data-action='dragstart->dragdrop#drag,drop->dragdrop#drop'>Some Text</li>

Or would I need another element as the drop target?


1 Like

Separate the action descriptors with a space. Just like CSS class names.

<li data-action="dragstart->dragdrop#drag drop->dragdrop#drop">Some Text</li>

Of course! Thanks so much!