Comments (2)
hey @CAYdenberg, your initialization is duplicating objects
var grid = Array(10).fill(Array(10).fill({value: null}));
console.log( grid[0] === grid[1] ) ) //true
console.log( grid[0][0] === grid[1][0] ) ) //true
The way you're initializing essentially copies the same object. The handleChange method uses an object equality. Either change the method to use proper index or initialize your grid differently:
var grid = new Array(10).fill(null).map(v => Array(10));
grid = grid.map(row => row.fill(null).map(col => ({value: null})));
console.log( grid[0] === grid[1] ) ) //false
console.log( grid[0][0] === grid[1][0] ) ) //false
from react-datasheet.
Thanks for your response. That makes sense.
from react-datasheet.
Related Issues (20)
- Callback while typing
- onCellsChange doesn't re-render changed cells HOT 1
- isCellNavigable is ignored when holding shift
- [Question]can react-datasheet work with Redux? HOT 1
- [Question] validate user's input when using react-datasheet as data input form HOT 1
- When I copy and paste from MS excel I am not getting exact value HOT 3
- Excel like Freeze Column HOT 1
- [Question] How to handle onDoubleClick for each cell? HOT 1
- Are types for default renderers, cell etc. missing?
- How to (programmatically) select all cells, then copy?
- feature request: influence enter key handling
- Allow Tab key in order to go out from the DataSheet to focus other DOM elements
- Bug: Copy and paste from MS Excel on a Windows machine pastes an extra empty cell HOT 1
- How do I initialize a datasheet with empty columns and rows which fills up my container? HOT 1
- What to use instead of deprecated `onPaste` function HOT 1
- Feature Request: Export as Excel/CSV HOT 2
- Does CTRL+Z word for undoing a paste? HOT 1
- Where can I see the code examples that are on the website? HOT 2
- Paste more rows than that is defined by the `grid`. HOT 2
- Deleting rows with Action Button HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-datasheet.