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

map, geocode, autocompleter Stimulus refactor from actions to outlets #2293

Merged
merged 3 commits into from
Aug 8, 2024

Conversation

nimmolo
Copy link
Contributor

@nimmolo nimmolo commented Aug 8, 2024

Changes the way map form Stimulus controllers call each other's methods, so that they call the method of the specific controller instance they need. This is necessary for forms where there is more than one autocompleter/map pair on the same page, so that they don't get their signals crossed. Also just seems like better code.

Changes from dispatching JS events, which may be picked up by all controllers on the page (and can only be routed to controllers by type), to calling methods on the controller itself via that controller's outlet identified by a unique id.

Also moves the autocompleter_field helper method and its helpers to a separate file.

@coveralls
Copy link
Collaborator

coveralls commented Aug 8, 2024

Coverage Status

coverage: 93.518%. remained the same
when pulling db417aa on recent-stimulus-changes
into 06aba12 on main.

@nimmolo nimmolo marked this pull request as ready for review August 8, 2024 06:30
@nimmolo nimmolo merged commit 99db4e9 into main Aug 8, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants