Resolve issue with autocomplete pre-filling back link #188
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Back links on the Provider and School onboarding (Claims and Placements) "Check your answers" pages need to redirect back to the "New" onboarding forms, with the user's selection pre-filled.
Once directed back, and the form is pre-filled, clicking continue should submit the form and take the user back to the "Check your answers" page.
Developer Insight
Due to an issue with the accessible-autocomplete, additional javascript and changes to how options are rendered needed to be added to
app/javascript/controllers/autocomplete_controller.js
. Otherwise, the result of usingdefaultValue
results in anundefined
option appearing in the dropdown.See alphagov/accessible-autocomplete#424 for more details.
Changes proposed in this pull request
PreviousSearch
tag added to html, to allow stimulus to assign the Provider/School name and id to the correct inputs.Guidance to review
Link to Trello card
https://trello.com/c/e5SwYKuK/138-fix-back-links-on-providers-schools-onboarding-pages-to-pre-fill-the-search-input-new-page-with-users-input
Screenshots
Screen.Recording.2024-01-31.at.16.21.18.mov