Grid disappears when combined with some bootstrap elements or useEffect

I encountered a weird behaviour. I think it might be a bug.


Consider the below snippet:

```

import { Col, Container, Navbar, Row } from "react-bootstrap";

import {
ColumnDirective,
ColumnsDirective,
GridComponent
} from "@syncfusion/ej2-react-grids";

import "@syncfusion/ej2-base/styles/bootstrap5.css";
import "@syncfusion/ej2-buttons/styles/bootstrap5.css";
import "@syncfusion/ej2-calendars/styles/bootstrap5.css";
import "@syncfusion/ej2-dropdowns/styles/bootstrap5.css";
import "@syncfusion/ej2-inputs/styles/bootstrap5.css";
import "@syncfusion/ej2-navigations/styles/bootstrap5.css";
import "@syncfusion/ej2-popups/styles/bootstrap5.css";
import "@syncfusion/ej2-react-grids/styles/bootstrap5.css";
import "@syncfusion/ej2-splitbuttons/styles/bootstrap5.css";

let data = [
// Data taken from your tutorials
];

function App() {
// When this is uncommented it makes the data grid disappear
// useEffect(() => {}, []);

return (
<>
<Navbar
sticky="top"
className="shadow-sm m-0 mb-3 py-2 px-4 w-100"
bg="light"
expand="lg"
collapseOnSelect
>
<Navbar.Brand>Brand</Navbar.Brand>
{/* When this is uncommented it also makes the data grid disappear */}
{/* <>
<Navbar.Toggle />
<Navbar.Collapse className="justify-content-end">
<Nav variant="pills" className="justify-content-center me-auto">
<Nav.Link>Link 1</Nav.Link>
<Nav.Link>Link 2</Nav.Link>
</Nav>
</Navbar.Collapse>
</> */}
</Navbar>
<Container
fluid
style={{ minHeight: "100%" }}
className="d-flex flex-column flex-fill p-0"
>
<Row className="flex-fill pb-3 g-0">
<Col className="h-100">
{/* Grid taken from your tutorials */}
<GridComponent dataSource={data}>
<ColumnsDirective>
<ColumnDirective field='OrderID' width='100' textAlign="Right"/>
<ColumnDirective field='CustomerID' width='100'/>
<ColumnDirective field='EmployeeID' width='100' textAlign="Right"/>
<ColumnDirective field='Freight' width='100' format="C2" textAlign="Right"/>
<ColumnDirective field='ShipCountry' width='100'/>
</ColumnsDirective>
</GridComponent>
</Col>
</Row>
<Row className="pb-3 g-0">
<Col>
{/* Other components removed for clarity */}
<Container />
</Col>
</Row>
</Container>
</>
);
}

export default App;

```

Like it is explained in the comments when either of the commented sections (the useEffect hook or the navbar contents) are used the data grid disappears. There is no error shown anywhere. Sometimes the grid even shows after a random sequence of page refreshes and/or re/saves of the source file.

I have tried to remove the bootstrap css files from the project but that does not seem to fix it.

Dependencies and dev-dependencies:
```

"dependencies": {
"@reduxjs/toolkit": "^1.8.5",
"@syncfusion/ej2-react-grids": "^20.2.49",
"bootstrap": "^5.2.1",
"date-fns": "^2.29.2",
"formik": "^2.2.9",
"react": "^18.2.0",
"react-bootstrap": "^2.5.0",
"react-bootstrap-icons": "^1.8.4",
"react-dom": "^18.2.0",
"react-redux": "^8.0.2",
"sass": "^1.54.8",
"yup": "^0.32.11"
},
"devDependencies": {
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^2.1.0",
"typescript": "^4.6.4",
"vite": "^3.1.0"
}

```

Using latest version of Google Chrome.


EDIT:

This problem only occurs when running the app via the dev server (`npm run dev`). Problem disappears when the app is built and served via a static server.


Any assistance is appreciated.


7 Replies

RR Rajapandi Ravi Syncfusion Team September 19, 2022 01:31 PM UTC

Hi Stanislav,


Currently, we are validating your query with your shared information, and we will update you the details on or before 21st Sep 2022. Until then we appreciate your patience.


Regards,

Rajapandi R



RR Rajapandi Ravi Syncfusion Team September 21, 2022 01:42 PM UTC

Hi Stanislav,


Thanks for your patience


Based on your query we have prepared a sample and tried to reproduce your reported problem at our end, but it was unsuccessful. The Grid doesn’t disappear. Please refer the below sample for more information.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/177562-2026968730.zip


If you still face the issue, please share any issue reproducible sample or try to reproduce the issue with our above attached sample.


Regards,

Rajapandi R




SD Stanislav Dimov September 26, 2022 10:04 AM UTC

Hi,


I have created a simplified project that illustrates the problem.


To reproduce:

  1. `npm i && npm run dev`

      2. Observe the data grid is present

      3. Uncomment the commented sections in `src/App.tsx` and save

      4. Restart dev server `^C`, `npm run dev`

      5. Observe the data grid has disappeared

 



Attachment: syncfusiontest_9d367f19.zip


RR Rajapandi Ravi Syncfusion Team September 27, 2022 02:05 PM UTC

Hi Stanislav,


Currently we are validating your shared information and we will update you the details on or before 29th Sep 2022. Until then we appreciate your patience.


Regards,

Rajapandi R



RR Rajapandi Ravi Syncfusion Team September 29, 2022 01:39 PM UTC

Hi Stanislav,


Thanks for the update


We have checked your shared sample in your last update and uncomment the commented codes and try to reproduce your reported problem, but it was unsuccessful. The Grid doesn’t disappear. Please refer the below sample and video demo for more information.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/177562136028805.zip


Video demo: https://www.syncfusion.com/downloads/support/directtrac/general/ze/177562vd-400738291.zip


If you still face the issue, please share any issue reproducible sample or try to reproduce the issue with our above attached sample.


Regards,

Rajapandi R



SD Stanislav Dimov September 29, 2022 03:51 PM UTC

I just tested that zip I gave you on my machine again and it definitely still disappears. Must be something unique to my setup.


How can I troubleshoot this?


EDIT:

Just tried to open in Firefox - problem is gone. When in Chrome however, it is present even under incognito mode, so I presume it is not due to some extension I have installed?


Chrome version is:

```

Version 105.0.5195.125 (Official Build) (64-bit)

```





RR Rajapandi Ravi Syncfusion Team September 30, 2022 01:09 PM UTC

Hi Stanislav,


Thanks for your update


Our chrome browser version was 106.0.5249.62 and the sample run without Grid disappears and working fine at our end. So please update your chrome browser and ensure that the problem was resolved or not.


Screenshot:



Regards,

Rajapandi R


Loader.
Up arrow icon