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

editable: true /* hangs when press enter */

Open txm opened this issue 10 years ago • 4 comments

When I set Editable to True, edit a cell, then press enter, FF/Chrome/OSX hangs.

When I edit and use the arrow keys to move off then it's fine.

I'm not sure where to start debugging...

React 14.

txm avatar Feb 01 '16 10:02 txm

Actually Chrome sorts itself out (obviously not timely enough for production) but does at least free up the browser again.

I realise debug versions of react etc. slow things down, but the examples (which I presume are still react 12?) are quick .. unless they are production which I guess they would be..

I know there are a bunch of React 14 related patches in the queue and wondered if they may be related. Similarly:

mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create

On the occasions I can get something out of FF it point to line 9734.

9705 // }, 9706 / 64 */ 9707 // function(module, exports, webpack_require) { 9708 9709 / WEBPACK VAR INJECTION /(function(process) {/* 9710 * Copyright 2014-2015, Facebook, Inc. 9711 * All rights reserved. 9712 * 9713 * This source code is licensed under the BSD-style license found in the 9714 * LICENSE file in the root directory of this source tree. An additional grant 9715 * of patent rights can be found in the PATENTS file in the same directory. 9716 * 9717 * @providesModule warning 9718 / 9719 9720 'use strict'; 9721 9722 var emptyFunction = webpack_require(54); 9723 9724 /* 9725 * Similar to invariant but only logs a warning if the condition is not met. 9726 * This can be used to log issues in development environments in critical 9727 * paths. Removing the logging code for production environments will keep the 9728 * same logic and follow the same code paths. 9729 */ 9730 9731 var warning = emptyFunction; 9732 9733 if (process.env.NODE_ENV !== 'production') { 9734 warning = function warning(condition, format) { 9735 for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 9736 args[_key - 2] = arguments[_key]; 9737 } 9738

txm avatar Feb 01 '16 10:02 txm

odd - all the examples are running master (so react 14, its 0.14.6 right now, but can move as we use ~ in packages), and debug not prod (so we get prop type validation, ie look at the console on http://adazzle.github.io/react-data-grid/examples.html#/all-features-immutable

bakesteve avatar Feb 01 '16 10:02 bakesteve

Thanks - I'm thinking there is something fundamental about ReactJS I'm missing, and it is the way I am passing in rows, coupled with the var _rows which seems to duplicate the state.rows in App.

getMatrixData(function(data){ let rows = data; //formatMatrixData(data, function(rows){ ReactDOM.render(, mountNode); //}); });

txm avatar Feb 01 '16 17:02 txm

I think I've solved it.. not 100% what it was, but probably a mix of _rows vs state/prop.rows, certainly user error and react noob.

txm avatar Feb 01 '16 23:02 txm