question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scrollableElement error when double clicking cell

See original GitHub issue

Describe the bug when double clicking cell tables gone and this error message show up ‘can’t access property “scrollableElement”, t is undefined’

Current behavior the table gone and error message show up

Expected behavior should be able to edit the cell

Screenshots or gifs image

Your environment details

  • Device: Desktop
  • OS: Arch Linux
  • Browser: Firefox, Google Chrome

Step to produce

  • completely follow the getting started guide

  • yarn create react-app --template typescript

  • yarn install @silevis/reactgrid

  • HERE IS THE App.tsx

import React from "react";
import "./App.css";

import {Cell, Column, ReactGrid, Row} from "@silevis/reactgrid";
import "@silevis/reactgrid/styles.css";

interface Person {
    name: string;
    surname: string;
}

const getPeople = (): Person[] => [
    {name: "Thomas", surname: "Goldman"},
    {name: "Susie", surname: "Quattro"},
    {name: "", surname: ""}
];

const getColumns = (): Column[] => [
    {columnId: "name", width: 150},
    {columnId: "surname", width: 150}
];

const headerRow: Row = {
    rowId: "header",
    cells: [
        {type: "header", text: "Name"},
        {type: "header", text: "Surname"}
    ]
};

const getRows = (people: Person[]): Row[] => [
    headerRow,
    ...people.map<Row>((person, idx) => ({
        rowId: idx,
        cells: [
            {type: "text", text: person.name},
            {type: "text", text: person.surname}
        ]
    }))
];

function Grid() {
    const [people] = React.useState<Person[]>(getPeople());
    const rows = getRows(people);
    const columns = getColumns();

    return (
        <div>
            {   // @ts-ignore
                (<ReactGrid columns={columns} rows={rows} />)
            }
        </div>
    )
}
function App() {
    return (
        <div className="App">
            <Grid />;
        </div>
    );
}

export default App;

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
sidikfahacommented, May 26, 2022

I fixed it by removing my <App /> component into the <React.StrictMode> tags.

Old index.tsx :

import React from 'react';
import ReactDOM from 'react-dom/client';
import "@silevis/reactgrid/styles.css";
import './styles/app.css';
import App from './views/App';
import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

reportWebVitals();

New index.tsx (working) :

import React from 'react';
import ReactDOM from 'react-dom/client';
import "@silevis/reactgrid/styles.css";
import './styles/app.css';
import App from './views/App';
import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
root.render(
    <App />
);

reportWebVitals();

0reactions
czerwiukkcommented, Jun 21, 2022

We’re currently building the next version of ReactGrid from the ground up and decided to leave this topic in the current state. If you want to use the current version, disable the strict mode while using React 18.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Excel 2016 will not allow mouse scroll when double clicked in ...
On excel 2016, I double click one of my formula cells and try to scroll with mouse wheel and it does not work....
Read more >
reactjs - Issue with cell double-click - Stack Overflow
On reactJS ag-grid, I need to be able to edit a cell on double clicking. I tried the following code. I do not...
Read more >
Double click Excel cell to follow formula not working - AuditExcel
Depending on your settings, double clicking a cell to follow the formula might not work, but instead allow you to edit the cell....
Read more >
Excel Error - Double clicking turns calculated cells to #N/A
Hi So Ive got a worksheet where if I double click in a cell in column A (or if I reference it from...
Read more >
How to double click a cell and add 1 to that cell value in Excel?
VBA code: Add 1 to a cell value with double clicking. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) On Error Resume...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found