Conversation
iamfrankiemoran
left a comment
There was a problem hiding this comment.
[P2] Remove scrolling owned by PO-8911
PO-8911 is the agreed global solution for resetting navigation to the top of the page, so this branch should not introduce a competing component-level scrolling mechanism. Remove this ngAfterViewInit implementation and the related fragment plumbing: DOCUMENT injection, section fragment constants/types, target IDs, [fragment] bindings, helper methods, and scroll tests. Apply the same removal to the payment-terms amend flow while retaining the relocated Change links.
@iamfrankiemoran the purpose of this work, is that when a user click on a 'section' change link, we are looking to scroll them to that particular section of the proceeding page/form e.g. user clicks on 'Employer details' under the 'Parent or guardian tab' they are then automatically scrolled to the 'Employer Details' part of the form. So in these conditions, we would want to avoid scrolling to the top of the page. |
Following discussion with the PO-8911 work, the intended approach is to configure Angular router scrolling centrally: withInMemoryScrolling({
anchorScrolling: 'enabled',
scrollPositionRestoration: 'top',
})This means ordinary navigation will open at the top, while Change links containing fragments will navigate to the corresponding form section.
|
@iamfrankiemoran this has now been implemented 👍 |
Jira link
See PO-2671
Change description
ngAfterViewInit()in the amend form components to scroll to the target section after navigation, because the fragment is only reliable for locating the section once the view exists in the DOM.Testing done
Security Vulnerability Assessment
CVE Suppression: Are there any CVEs present in the codebase (either newly introduced or pre-existing) that are being intentionally suppressed or ignored by this commit?
Checklist