react-data-grid icon indicating copy to clipboard operation
react-data-grid copied to clipboard

2.0.32 breaks the grid (removeScroll is not a function.)

Open jarkkoSky opened this issue 9 years ago • 5 comments

HAVE YOU ALREADY SEARCHED FOR SIMILAR ISSUES? PLEASE HELP US OUT AND DOUBLE-CHECK FIRST!

ALSO, PLEASE DON'T BE THAT PERSON WHO DELETES THIS TEMPLATE. IT'S HERE FOR A REASON.

THANKS!

WHICH VERSION OF REACT ARE YOU USING?

Officially Supported:
[ ] v0.14.x
Community Supported:
[x] v15.0.x

WHICH BROWSER ARE YOU USING?

Officially Supported:
[ ] IE 9 / IE 10 / IE 11
[ ] Edge
[x] Chrome
Should work:
[ ] Firefox
[ ] Safari

I'm submitting a ... (check one with "x")

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/adazzle/react-data-grid/blob/master/CONTRIBUTING.md

Current behavior

Grid breaks immediately when rendered with the error: Uncaught TypeError: t.cells[r].removeScroll is not a function.

Expected/desired behavior

Reproduction of the problem If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?

What is the motivation / use case for changing the behavior?

jarkkoSky avatar Apr 27 '17 12:04 jarkkoSky

Possible fix:

HeaderRow.js: 152

if (this.cells[i] && this.cells[i].removeScroll) { 
this.cells[i].removeScroll(); 
}

crazywako avatar Apr 27 '17 12:04 crazywako

Found the fault. We are using DraggableHeaders from react-data-grid-addons ( enableDragAndDrop={true} and this.columns = [...{key: 'name', name: 'Name', draggable: true}]). Remove scroll isn't implemented for DragDropContainer.

Screenshot: http://imgur.com/a/Zwl7y

In this image you see that this.cells contains many columns which some are normal HeaderCell (Object) and others are DragDropContainer which doesn't have removeScroll implemented. Could you please fix that?

crazywako avatar Apr 28 '17 06:04 crazywako

Am having about the same issue with setScrollLeft.

this.cells = Array(12) 0 : null 1 : null 2 : null 3 : null 4 : null 5 : null 6 : null 7 : null 8 : null 9 : null 10 : null 11 : null length : 12

yairniz avatar Apr 30 '17 14:04 yairniz

@yairniz This is another issue, documented in #732.

michielboekhoff avatar May 02 '17 16:05 michielboekhoff

I believe this issue had already been addressed. Feel free to reopen if you still experiencing this issue.

amanmahajan7 avatar Aug 16 '17 03:08 amanmahajan7