update handler for legacy component events #33805
Merged
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.
Description
This pull request fixes an issue in production where the footer accordion isn't opening properly for pages built with Next Build. This change removes an
if
statement that wasn't working anyway because of a syntax error, and replaces the check with a promise that waits fordocument.readyState: 'complete'
if it isn't already that value.We can't use
readyState: 'interactive'
because event listener attachment doesn't play well with that, and we can't rely onDOMContentLoaded
because it doesn't work as expected with NextJS. Instead, we wait forreadyState: 'complete'
to ensure all assets are loaded properly, and then we register listeners for the legacy accordion, sidenav, and additional info components.Are you removing, renaming or moving a folder in this PR?
Examples of a TeamSite: https://va.gov/health and https://benefits.va.gov/benefits/. This scenario is also referred to as the "injected" header and footer. You can reach out in the
#sitewide-public-websites
Slack channel for questions.Did you change site-wide styles, platform utilities or other infrastructure?
Summary
Related issue(s)
Testing done
generated
folder in vets-website to the same folder innext-build/public/generated
, which is currently pulled from vets-website prod s3.Screencaps
NB:
Screencast from 12-30-2024 12:05:14 PM.webm
vets-website:
Screencast from 12-30-2024 12:05:47 PM.webm
content-build:
Screencast from 12-30-2024 12:11:07 PM.webm
proxy-rewrite:
Screencast from 12-30-2024 12:21:48 PM.webm
What areas of the site does it impact?
VA.gov footer
Acceptance criteria
Quality Assurance & Testing
Error Handling