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

Error fixes #2968

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Error fixes #2968

merged 1 commit into from
Jun 19, 2024

Conversation

DaniBitZesty
Copy link
Contributor

📝 A short description of the changes

  • Corrects how 'step-errors' class is removed from side panel links to form sections, it was previously excluding links two-levels below elements with 'steps-progress-bar' class, so section C.1, C.2, C.3 links weren't targeted and the error icon persisted even after errors had been corrected

  • Fixes missing errors for incomplete subfields on the initial render of the form. Previously, validation errors for hidden subfields were not displayed when navigating via the side panel links or the error summary links. These errors only became visible after navigating to another form section and then returning, this was because of .filter(:visible), which excluded hidden elements from the validation process.

🔗 Link to the relevant story (or stories)

:shipit: Deployment implications

✅ Checklist

  • Features that cannot go live are behind a feature flag/env var or specify deploy date and open PR as draft
  • I have checked that commit messages make sense and explain the reasoning for each change
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have squashed any unnecessary or part-finished commits

🖼️ Screenshots (if appropriate - no PII/Prod data):

@@ -190,7 +190,7 @@ window.FormValidation =

addSubfieldError: (question, subquestion) ->
questionRef = question.attr("data-question_ref")
input = $(subquestion).find('input,textarea,select').filter(':visible')
input = $(subquestion).find('input,textarea,select')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually not sure about this, cause this somehow might impact some weird conditional questions if we have a question where the subfield is hidden 🤔

…rs not appearing on subfields on first render
@DaniBitZesty DaniBitZesty merged commit f24134d into main Jun 19, 2024
11 checks passed
@DaniBitZesty DaniBitZesty deleted the tweak-sidebar-steps branch June 19, 2024 09:37
@DaniBitZesty DaniBitZesty restored the tweak-sidebar-steps branch July 3, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants