Is it intentional that parent controllers also listens to actions within child controller?

Hi :wave:,

Using example from, I have the following gallery controllers nested:

<div data-controller="gallery">
  <div data-controller="gallery"

I found out that the parent gallery controller also listens to the child action. Is this intentional? If this is intended, do you have advice on how to make the parent controller not listening to the child action?

I’m using Stimulus 1.1.1

Hey @firewalker06!

I realized I was completely mistaken in my initial response and that Stimulus does support nested scopes that allow controllers to be nested without the type of duplication you’re seeing. This was discussed here. So doubling up on window events (which I’m able to reproduce) seems like a bug. Good catch! Apologies for the earlier, misleading response!

No problem. Thanks for the reference and confirming this bug, @welearnednothing.

This does appear to be a bug with global actions. Reproduced here: Would you mind opening an issue on GitHub?

1 Like