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.
Notice for Bug/1386:
Design Website System
We want to set Get Started Menu Item active, whenever we visit any sub children links such as
vscode
orsetup
At first I tried to modify the logic of setCurrentLink() function, especially this logic:
We always will have an edge case, for example:
If the website I set up has a base URL:
http://localhost:4200/ui-components/
, and if I navigate to a URL such as "http://localhost:4200/ui-components/#/button-group" it will end up active at My Profile which is not correct. What I try to sum up is it really depends on developers who want the menu to be active in what occasion. For example the first linkMy Profile
doesn't really care abouthref
, it is based on the actionnavigateLink
So I came up with an idea, adding
aria-current
which is a valid HTML attribute fora
:https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current
The testing code below will showcase how we can use
aria-current
to control whatever menu item we want to be active. Ifaria-current
isn't set, we will fall back to a default using a link as a detection like the current logic.