Skip to content

Warnings for targets not inside controllers #127

@DawidJanczak

Description

@DawidJanczak

Hello,

We have some complex partials reused between different controllers and we end up with markup like this:

<div
  ...
  data-foo-my-target='input'
  data-bar-my-target='input'
>

The thing is when we render the partial containing this we will only ever have one of these controllers. So another partial containing FooController will render this once and yet another partial containing BarController will render this elsewhere.

This leads to The Stimulus target '${targetName}' is not inside the Stimulus controller '${controllerId}' I wonder if there's a way to handle this? Or is there an idiomatic Stimulus way of not doing what we're doing? As far as I understand the above is valid in Stimulus world, but I may be wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions