Skip to content

[EuiDataGrid] Full screen mode can sometimes be quirky with adding the body class #5092

Closed

Description

@cchaos

It's super replicate-able with the first example on https://elastic.github.io/eui/#/tabular-content/data-grid-virtualization where you see a flash of it adding the body class then it gets instantly removed again.

Screen.Recording.2021-08-25.at.03.36.51.PM.mp4

Activity

  1. changed the title [-][EuiDatGrid] Full screen mode can sometimes be quirky with adding the body class[/-] [+][EuiDataGrid] Full screen mode can sometimes be quirky with adding the body class[/+] on Aug 26, 2021
  2. kqualters commented on Aug 31, 2021

    @kqualters
    Contributor

    The problem is this line https://github.com/elastic/eui/blob/master/src/components/datagrid/data_grid_toolbar.tsx#L78 , I think the intention was to add the class if not there otherwise do nothing if isFullScreen is true, and remove the class if it is there otherwise do nothing if isFullScreen is false. Instead, it's toggling the class on every render if isFullScreen is false

  3. kqualters commented on Aug 31, 2021

    @kqualters
    Contributor

    I think just changing the code back to how it was before #5008

    if (typeof document !== 'undefined') {
        // When data grid is full screen, we add a class to the body to remove the extra scrollbar
        if (isFullScreen) {
          document.body.classList.add('euiDataGrid__restrictBody');
        } else {
          document.body.classList.remove('euiDataGrid__restrictBody');
        }
     }
    

    will fix the issue

  4. added 2 commits that reference this issue on Nov 8, 2021
    99de8bc
    7ca1bc8
  5. cee-chen commented on Jan 5, 2022

    @cee-chen
    Contributor

    This was closed by #5334 / 99de8bc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions