Closed geoffrich closed 9 months ago
The challenge we have here is that tools are limited and content is inconsistent. Meaning, when one closes and one opens, this causes the page to jump.
This is the code that currently tries to maintain a central position, but like you point out, it's inconsistent. I'm hesitant to use a brute-force solution where we always move the accordion header to the top of the view.
Yeah, I'm not sure what the right solution is here. But I think it's an issue that a user can open an accordion and end up in the middle of the content, potentially missing anything at the top (especially when form fields are in the accordion). If there isn't a one-size-fits-all solution, is there a way to allow customization of this behavior?
Also, do we know how/if other accordion implementations handle it?
I also wonder if there's a way to delay calling scrollIntoView until after the height has finished transitioning. But idk if that's the root issue.
I also wonder if there's a way to delay calling scrollIntoView until after the height has finished transitioning. But idk if that's the root issue.
That is what the feature I pointed out is supposed to do. We did so some reviews with other devs and design regarding the current solution. I am curious where this issue is stemming from? Is there a complaint or is this a personal observation? I don't know how to assign priority to this issue.
The current solution sets the height synchronously, but that doesn't mean that the height has finished transitioning when we start scrolling. So there might be something we can do there. But it's definitely a tricky issue.
This issue was raised by our UX designer when reviewing our contact tracing form, so it's not just my personal observation. The form fields for each passenger are in the accordion, and the concern is that guests might miss the field at the top (email address) if it's scrolled out of view after opening the section.
i am putting the help-wanted
tag on this one. While I agree it is something to be reviewed, unless a case is made, I can't see this being more of a priority than our other current priorities.
Needs input from UX on what the intended best behavior should be in edge cases like this.
This issue was resolved to the best of our ability with the latest v3.0 release.
Describe the bug
When opening another accordion in a group, sometimes the auto-scroll moves the opened accordion heading out of view. This can cause users to miss content at the start of the accordion.
This was a hard bug to repro, but it seems to be correlated with 1) mobile screen heights and 2) long content inside the accordion. I've only been able to repro in Chrome, not Firefox. I've also seen it on iOS but had a hard time getting a minimal reproduction.
To Reproduce
Use the following HTML:
Note: styles are important so that the accordion content has sufficient height.
Expected behavior
When opened, the top of an accordion is always in view.
Screenshots
GIF of the issue:![accordion-bug](https://user-images.githubusercontent.com/4992896/147160437-d99dc112-6538-4542-8b13-f79d60d5b9da.gif)
Desktop (please complete the following information):