Skip to content
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

[Bug]: Grey hero variant: description list is ordered incorrectly at mobile #3487

Open
helenb opened this issue Feb 3, 2025 · 0 comments
Open
Labels
Bug Something isn't working Community backlog An issue raised on the community backlog High priority

Comments

@helenb
Copy link

helenb commented Feb 3, 2025

Describe the bug

In an onsHero component, we can pass in a description list. This renders in the wrong order at mobile (the desktop ordering is correct)

Current ordering at mobile:

Image

And at desktop:

Image

Expected behaviour / outcome

The desktop order should remain the same.

The mobile order should be as follows (note that the spacing between definition term and the definition description is not correct in this example - it should be aligned as if in columns as in the example above):

Image

List the steps necessary to reproduce the bug

You can use the following config to test:

{{
        onsHero({
            "topic": "Statistical article",
            "title": page.display_title,
            "variants": 'grey',
            "text": "Summary text",
            "detailsColumns": 12,
            "descriptionList": {

                "descriptionListLabel": "",
                "termCol": "6",
                "descriptionCol": "6",
                "itemsList": [
                    {
                        "term": "Release date",
                        "descriptions": [
                            {
                                "description": "28 January 2025"
                            }
                        ]
                    },
                    {
                        "term": "Edition",
                        "descriptions": [
                            {
                                "description": "Latest"
                            }
                        ]
                    },
                    contact_details,
                    {
                        "term": "Next release",
                        "descriptions": [
                            {
                                "description": "28 February 2025"
                            }
                        ]
                    },
                    {
                        "term": "Releases",
                        "descriptions": [
                            {
                                "description": "View previous releases",
                                "url": "http://www.example.com",
                            }
                        ]
                    },
                ]
            },
            "breadcrumbs":
                {
                    "ariaLabel": 'Breadcrumbs',
                    "itemsList": [
                        {
                            "url": '/',
                            "text": 'Home'
                        },
                        {
                            "url": '/components',
                            "text": 'Components'
                        }
                    ]
                }
        })
    }}

Additional context

A grid layout may be a good solution here. See the markup and CSS used in the beta build:

https://github.com/ONSdigital/dis-wagtail/blob/main/cms/jinja2/templates/pages/statistical_article_page.html#L34-L63

https://github.com/ONSdigital/dis-wagtail/blob/main/cms/static_src/sass/components/_common-header.scss#L38-L57

What version of the ONS Design System are you using?

72.2.0

What device(s) are you using?

Desktop

What operating system(s) are you using?

macOS

What browser(s) are you using?

Chrome

@helenb helenb added Bug Something isn't working Community backlog An issue raised on the community backlog High priority labels Feb 3, 2025
@helenb helenb changed the title [Bug]: Grey hero component: description list is ordered incorrectly at mobile [Bug]: Grey hero variant: description list is ordered incorrectly at mobile Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Community backlog An issue raised on the community backlog High priority
Projects
None yet
Development

No branches or pull requests

1 participant