Skip to content

Fixes a horizontal scrolling issue for json tables

What does this MR do and why?

Fixes a horizontal scrolling issue for json tables, they was previously no horizontal scroll capability.

Added bootstrap class for max-width:100% to json-table div to enable a scroll bar.

reference: https://gitlab.com/gitlab-org/gitlab/-/issues/428266

Changelog: Fixed Horizontal Scrolling for JSON Tables

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

  • Before: image
  • After: image

How to set up and validate locally

  1. Create a JSON Table that is wider than a wiki page.
  2. Verify that there is now a scroll bar allowing you to horizontally scroll and view the full width of the table.

Example

Click here to test!
{
    "items":
    [
        {
            "a": "table row",
            "b": "table row",
            "c": "table row",
            "d": "table row",
            "e": "table row"
        }
    ]
}
{
    "items":
    [
        {
            "a": "table row",
            "b": "table row",
            "c": "table row",
            "d": "table row",
            "e": "table row",
            "f": "table row",
            "g": "table row",
            "h": "table row",
            "i": "table row",
            "j": "table row",
            "k": "table row",
            "l": "table row",
            "m": "table row",
            "n": "table row",
            "n": "table row",
            "n": "table row",
            "o": "table row",
            "p": "table row",
            "q": "table row",
            "r": "table row",
            "s": "table row",
            "t": "table row",
            "u": "table row",
            "v": "table row",
            "w": "table row",
            "x": "table row",
            "y": "table row",
            "z": "table row"
        }
    ]
}
Edited by Miguel Rincon

Merge request reports