I just got started with StimulusJS and I am in the process of integrating it with my WordPress plugin. For my use case I have lot of input fields on different areas of a page. In one area I have an input to collect a book’s ISBN and beside it a button that takes the user input then fetches data via an API. When the data is returned it used to update inputs in another section of the page.
So I am using
this.dispatch() to pass data between 2 controllers are per the StimulusJS tutorial.
However, when I do this I am getting an error about a missing target element. You can see an abridged version of my code here with the same error.
Does anyone here have a workaround?