-
Notifications
You must be signed in to change notification settings - Fork 321
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
Accordion: Deep links to an anchor in another section do not work if the section is not expanded. #1581
Comments
I've had a look at how GOV.UK's Manuals deal with this and they look detect when a link inside a section is focused, then open the section if it is: Update: Actually that's not related but will leave this comment for reference. |
Is this also going to be an issue with Details, Tabs, Conditional Reveals etc? |
I've noticed we do something similar on the design system website to show content: http://localhost:3000/components/error-message/#options-error-message-example We should consider making sure that users can disable this code, perhaps by It may be that we can remove some custom code in the design system website. |
It looks like the original team has managed to work around this for now. We think this could be a complicated fix so we're going to pause our investigation and see if anyone else runs into this issue before prioritising it. |
This is something that GOV.UK are currently adding in their additional accordion JavaScript: I've added this for consideration for a future 5.x release. I'd suggest we could implement by listening for the |
There is a need for this in my current prototype at DfE. We are working on https://www.find-postgraduate-teacher-training.service.gov.uk/ This service allows users to find postgraduate teaching courses in England if they want to teach in a state primary or secondary school, or in further education. The user need we are exploring is to allow candidates to easily compare courses. This is something which is currently very difficult, as the course pages are long and overwhelming, and contain a lot of duplicate information. We are currently exploring the use of an accordion to help users navigate the information. As part of this, we wanted to provide users with a deep link from two sections at the top of the page, one on 'Fees and financial support', and one on 'How placements work'. We are unable to do this in the current prototype, I can anchor to the accordion section id, but I cannot open the section. |
Uh oh! @kelliedesigner, the image you shared is missing helpful alt text. Check #1581 (comment). Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image. Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.
|
I think there are two slightly separate things being discussed here: Opening sections when following a link to a target within a section.I think this should now 'just work' in Chromium-based browsers because of the use of
However, this remains a Chromium-exclusive feature although both Webkit and Mozilla have shown positive signals towards implementing it:
Opening sections by linking directly to a sectionI think this is what @kelliedesigner is requesting. This isn't covered by GOV.UK Publishing Components continue to include additional JavasScript which covers both of these features. |
jennifer-hodgson's original comment
The text was updated successfully, but these errors were encountered: