-
Notifications
You must be signed in to change notification settings - Fork 333
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
Hide Accordion content (again) during .js-enabled
page load
#3095
Conversation
Still antsy about this, really, as although it reduces the layout shift on load, it's still shipping something that doesn't work properly if JavaScript fails. Doesn't feel very progressive enhancement of us. As that's a bigger problem to fix across multiple components though (#999), and it being something we'll probably have to deal with soon when dropping JS support in IE, I'm happy to sit on my hands for now. |
@querkmachine Yeah, same thoughts here If it helps, I'm thinking this PR solely serves to keep a consistent baseline for the next release (So we've not made anything that could be considered worse for some users since the last release) Similar to how we use |
I agree with @querkmachine that this isn't ideal. The risk of users not being able to see the content is, IMO, more damaging than them seeing a flash of content. We do do this elsewhere where we interact with After ticking this over I unfortunately don't have any quick alternatives. It is technically the same as v4.4.0 and it allows us to ship a neat enhancement, so whilst it's a problem it's not explicitly a regression. I'm gonna wait and see if anyone else has opinions but the options I see right now are:
Im leading towards 1. If nobody has any other feelings I'll approve this in the afternoon. |
I forgot to request a changelog entry
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'm not sure if this needs a changelog entry or not. I'm leaning towards "yes" unless somebody thinks otherwise.
Thanks @owenatgov Knowing that this could go either way we did a minor padding fix in this one: (So should we keep the flicker, at least it's a beautiful flicker 😊) Had a quick run through Tabs and there's another interesting middle ground. With slow-loading JS you can still click a tab and it'll (eventually) catch up via Will be a shame to merge this PR but gives us more time to fully consider:
|
@colinrotherham That PR you've linked needs a changelog entry as well! I initially wondered if this should have a change entry on the basis that this was technically a revision of an existing PR, however I'm not quite confident that it does. |
@owenatgov Ahh the padding fix will soon be hidden, can't do a change entry if the fix never gets rendered 😉 I'll do a quick one though for the mobile height, button margin and (maybe) trailing attribute space? |
IMO this PR doesn't need a separate changelog entry as it's basically a continuation of the |
Some other related changes from the archive: |
js-enabled
page load.js-enabled
page load
60f87a2
to
6d08bd2
Compare
@owenatgov @querkmachine @claireashworth Can you check these two new commits for me please?
Or see the full CHANGELOG.md on this branch |
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.
A few comments on the changelog, mostly making the content leaner in line with how we generally write up changes. I'll let @claireashworth come in with further thoughts on the content, although it might make sense to instead do this as part of the complete 4.4.1 changelog review.
CHANGELOG.md
Outdated
|
||
Note: To improve the reading experience on slow loading pages we initially removed `display: none` from each Accordion section. To avoid a flicker of content, we've chosen to restore the current behaviour in [pull request #3095](https://github.com/alphagov/govuk-frontend/pull/3053). | ||
|
||
We’d like to take another look at how components load in: [issue #999: Components failing initialisation break due to `.js-enabled` styles](https://github.com/alphagov/govuk-frontend/issues/999). |
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 don't think this line is necessary. I think you're being considerate in including it, however we do reference this issue in this PR and users can come here to see the discourse if they are interested in the issue.
CHANGELOG.md
Outdated
- [#3053: Enhance the Accordion component with `hidden='until-found'`](https://github.com/alphagov/govuk-frontend/pull/3053) | ||
- [#3095: Hide Accordion content (again) during `.js-enabled` page load](https://github.com/alphagov/govuk-frontend/pull/3053) | ||
|
||
Note: To improve the reading experience on slow loading pages we initially removed `display: none` from each Accordion section. To avoid a flicker of content, we've chosen to restore the current behaviour in [pull request #3095](https://github.com/alphagov/govuk-frontend/pull/3053). |
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 don't think this line is necessary. You already reference this PR on line 16 and I think providing the link is enough.
CHANGELOG.md
Outdated
This was added in pull requests: | ||
|
||
- [#3053: Enhance the Accordion component with `hidden='until-found'`](https://github.com/alphagov/govuk-frontend/pull/3053) | ||
- [#3095: Hide Accordion content (again) during `.js-enabled` page load](https://github.com/alphagov/govuk-frontend/pull/3053) |
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.
Wonky link
- [#3095: Hide Accordion content (again) during `.js-enabled` page load](https://github.com/alphagov/govuk-frontend/pull/3053) | |
- [#3095: Hide Accordion content (again) during `.js-enabled` page load](https://github.com/alphagov/govuk-frontend/pull/3095) |
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.
Good spot
We're pausing this PR in favour of getting a fix release out in order to get a critical chrome bug released and give ourselves a bit more time to discuss the tradeoff's of this PR and it's interaction with #3053. |
6d08bd2
to
9a93e5e
Compare
9a93e5e
to
0b011a5
Compare
When loading the Accordion component with JavaScript enabled, this change restores `display: none` on section content For context, we switched to `display: inherit` previously: #3053 But for slow-loading pages we saw a visual layout shift as each section flickered closed (from open) after initialisation We’d like to take another look at how components load in: #999
0b011a5
to
ecca61d
Compare
We discussed this team today and agreed that we want to take a proper look at #999, but in the meantime we're happy to merge this as it basically maintains the 'status quo'. |
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.
Does the job 👍🏻
This PR investigates an Accordion change to avoid a visual layout shift
During a slow page load (with
js-enabled
class on<body>
) we now see Accordion sections jump from open to closed after component initialisation. We're not sure if this is preferred for users.For example, shown when adding a 500ms delay before our code runs
For discussion, I've included a quick tweak which keeps all the enhancements from:
hidden='until-found'
#3053