18F / dol-whd-14c

The 14(c) system will become a modern, digital-first service. Applicants will be provided an intuitive online experience, guiding them through the information needed to complete their application correctly.
Other
16 stars 17 forks source link

Anchor links issue with Angular4 #336

Open jmmcnj opened 7 years ago

jmmcnj commented 7 years ago

As an Application User I would like click the "Skip To Main Content" link so that the page will scroll down AND focus on the #mainContent div

Angular 4 doesn’t support anchor links all that well out of the box -- at least not intuitively (see angular/angular#6595). I found several forum threads and discussions surrounding this issue that offer potential fixes that only involve refactoring the code without adding any additional npm packages. However, none of those fixes worked for me. I think that is because of how we have setup the AngularJS and Angular (4) combination in our app. I can definitely refactor the code so that the header component where the “Skip to main content” link lives is an AngularJS component/directive instead of an Angular4 one – this would be working against our efforts to eventually switch to Angular 4 so I only want to use it as a last resort. The pure fixes that I mentioned previously involve an Angular4 component in an app that uses Angular4 routing. We are not currently using Angular4 routing in our app. I believe that in order to keep the header an Angular4 component and still fix the “Skip To Main Content” link to scroll to a section within the same page, we will need to do a broader refactoring of the routing and current application setup from a front-end perspective.

Acceptance Criteria

Functionality

Accessibility

davoodharun commented 6 years ago

@mmurthydol as per our discussion today, #364 will address the need for using an anchor link but will not address anchor linking with Angular4 components. Can we move this story back into the backlog or at least redefine it?

mmurthydol commented 6 years ago

@davoodharun Can we discuss this in appear.in after standup before redefining/moving it to backlog? Thx

jmmcnj commented 6 years ago

Need to implement karma tests still not working/finalized

jmmcnj commented 6 years ago

Need to implement karma tests still not working/finalized

mmurthydol commented 6 years ago

Will be addressed when AngularJS is converted to Angular 4 (if ever)