-
Notifications
You must be signed in to change notification settings - Fork 237
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
Replace back link placeholder URLs with JavaScript #1103
Conversation
looks good! I don't think the hover thing is an issue. Needs an entry in Changelog I think |
8f106ee
to
1e05b5c
Compare
Not 100% sure, but you could argue this is a 'new feature' rather than a fix and therefore needs a more extended changelog entry to explain the change to users |
In most cases, the back button should simply go back to the referring page, so we can use `window.history`.
efde4aa
to
1bf6493
Compare
I've added a feature CHANGELOG entry. |
1bf6493
to
55f5f4c
Compare
55f5f4c
to
8fd1929
Compare
|
||
## New features | ||
|
||
### Replace back link placeholder URLs with javascript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Replace back link placeholder URLs with javascript | |
### Replace back link placeholder URLs with JavaScript |
|
||
### Replace back link placeholder URLs with javascript | ||
|
||
Previously, users had to manually replace the `href` for each back link in the page templates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, users had to manually replace the `href` for each back link in the page templates. | |
You can now use JavaScript to make the [back link component]( https://design-system.service.gov.uk/components/back-link/) take users to the previous page by default. |
|
||
Previously, users had to manually replace the `href` for each back link in the page templates. | ||
|
||
Now, we use JavaScript to make the back link take you to the previous page by default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, we use JavaScript to make the back link take you to the previous page by default. | |
Before, you had to manually replace the `href` attribute for each back link in the page templates. |
|
||
Now, we use JavaScript to make the back link take you to the previous page by default. | ||
|
||
This approach is not appropriate for production scenarios, where you cannot rely on JavaScript being available at all times. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach is not appropriate for production scenarios, where you cannot rely on JavaScript being available at all times. | |
Do not use this approach for production scenarios, where you cannot rely on JavaScript always being available. |
|
||
This approach is not appropriate for production scenarios, where you cannot rely on JavaScript being available at all times. | ||
|
||
You can still override the `href` attribute if you need different behaviour. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth giving an example of different behaviour? Or would that be overkill?
After a chat with @EoinShaughnessy, we've decided it'll be easier for the 2i reviewer if all changelog/release note changes are in one PR. So we're going to merge this as-is and incorporate the suggested release note changes into a separate PR with the other changelog changes. |
In most cases, the back button should simply go back to the referring page, so we can use
window.history
.Closes #494
There is a small potential issue when hovering on the link, as browsers will display the
href
property in the status bar, which in this case is just some javascript (as shown in the image below).I'm not sure how much of an issue this is for prototyping.