-
Notifications
You must be signed in to change notification settings - Fork 337
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
[Spike] Immediately hide the page when the Exit this Page button is interacted with #2949
[Spike] Immediately hide the page when the Exit this Page button is interacted with #2949
Conversation
Solid work once again @querkmachine. Some thoughts:
|
Fixed. Shh. 🤫 |
I've now tested this in a few versions of Safari on iOS and Chrome on Android. I've added a new section, "Other note: Scrolling on mobile devices" into the findings. The other sections remain accurate based on my experiences. |
Sorry for the delay looking at this. I think it looks good, it works immediately and doesn't feel wrong. Agree that a plain white screen is preferable to trying to add any visual indicators. V nice enhancement 👍 |
fb8d91e
to
ceb581d
Compare
c758d93
to
15fc0dc
Compare
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.
I didn't get around to merging this so I'll give @querkmachine that honour. I have one errant comment but otherwise this looks great.
15fc0dc
to
41521f5
Compare
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.
Lovely 💪🏻
Spike for alphagov/govuk-design-system#2389. Immediately applies a white overlay on top of the current page when the Exit this Page button has been activated, to prevent a slow connection potentially leaving the page content visible for longer than desired.
Tested in:
Changes
Investigations
Does the ghost page need some text or a loading indicator?
I personally don't think this is necessary, for the following reasons:
With those aspects in mind, I believe—to quote Ronan Keating—"you say it best, when you say nothing at all".
Does the ghost page functionality still work if the button is a standard link and doesn't use
e.preventDefault
?In all browsers tested, the ghost page is activated without requiring
preventDefault
.What are the risks of the functionality breaking and leaving the user on a screen they cannot interact with?
If the component is misconfigured and the URL being redirected to is malformed, or it directs to a URL that cannot be displayed by the browser and will be downloaded instead (e.g. a Word document), then the user will be stuck on the ghost page.
In Chrome and Safari, clicking the back button from the redirected page restores the page's previous state—including the white overlay. (A fix for this problem exists on the conditional radio button reveals, so may be resolveable.)
If the user purposefully halts the loading of the new page, then they will remain on the ghost page. This is potentially a problem in conjunction with the 3× Escape key functionality, as all tested browsers will stop an in-progress page load when the Escape key is pressed. For example, if a user accidentally presses the Escape key four times, they will activate the ghost page but halt the loading of the subsequent page.
Other note: Scrolling on mobile devices
On both Safari/iOS and Chrome/Android, the user is still able to scroll the page when the 'ghost' overlay container is open. When doing so, page content can be briefly seen below the container.
This is because the overlay is styled with
position: fixed
with all sides (top/right/bottom/left) set to 0, however scrolling causes the mobile UI to expand and collapse, in turn changing the dimensions of the 'ghost'. I don't think this is a blocking issue, as it's only possible during the brief period between the ghost page kicking in and the user being navigated away, and it requires user intervention to make occur.