Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom targetAttributeForScope breaks target lifecycle callbacks #809

Open
koenkivits opened this issue Jan 21, 2025 · 0 comments · May be fixed by #810
Open

Custom targetAttributeForScope breaks target lifecycle callbacks #809

koenkivits opened this issue Jan 21, 2025 · 0 comments · May be fixed by #810

Comments

@koenkivits
Copy link

koenkivits commented Jan 21, 2025

When using a custom targetAttributeForScope callback, target (dis)connected callbacks no longer work. This seems to be because TargetObserver hardcodes the default attribute format:

private get attributeName() {
return `data-${this.context.identifier}-target`
}

All target properties on the controller ([name]Target, has[Name]Target, etc) do work as expected.

koenkivits added a commit to koenkivits/stimulus that referenced this issue Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant