-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding keyboard nav, tests, gulp, react 0.11.1 #12
Conversation
ignore ANY build directories add jshint
would need to pass this in (via a prop? or a column prop?) also needs to support moving cells, which means also operating at the row level
add build instructions to readme Update README.md
…oken, but basics there
keyboard scrolling in locked pane not keeping main pane in sync 100%
better handling of height at the grid level needs a bit of cleanup
Gulp task to build - but not happy with the way we are using a temp task for browserify refs. think webpack is worth a go jasmine tests for some key areas doing some DOM tests so split to core (ie node compliant) and browser next step is use jest / similar to get better fakes (inc DOM) and plugin phantomjs to run these automatically and a gulp watch task to pluygin to changes in tests or source and re-run the tests going fake-dom will help keep that nice and fast
Closes #8 |
@andreypopp here you go As I said - we thought this repo was dormant so may have been more radical / opinionated on tooling etc than was warranted, but you can now do Let me know your thoughts on this, both from a tooling / tests point of view, and on the react side of things for keyboard nav, and for the scrolling. We are relative newcomers to React, so may have taken some odd paths / done things in the wrong way we've also listed what we'd like to see happen to extend this here - and be happy to collaborate on getting a roadmap pulled together |
|
||
choco install atom | ||
choco install nodejs.install *if typing npm gives you an error* | ||
git clone https://github.com/adazzle/react-grid *in the root directory you want your files in* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have the wrong repo here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep - as I said at the top of the PR, this wasnt really designed to be a PR back to the base fork - hence being 4 or 5 major alterations in one
But I'll clean that up
I'm curious as to why we would need to merge excel functionality into the base grid? Can we not just have a second component that's not part of this that adds in the excel functionality? |
@@ -3,9 +3,9 @@ | |||
*/ | |||
"use strict"; | |||
|
|||
/* jshint esnext: true, unused: false, undef: false */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personal preference maybe, but seems like a .jshintrc file would be a bit cleaner than sticking the declaration at the top of each file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree (apart form maybe esnext?) - was mostly just trying to reduce the jshint noise
I'd rather not have the unused / undef as false
Sorry to hijack the PR. We are debating using this on a new project at the company and I'm always concerned about library size. Thanks for fixing the 0.11 issues though, that's super helpful. |
@jackofseattle – yes, I did wonder if this wasn’t better placed as an extension The only real changes required to the Grid were to add SelectedCells and Row / Cell click events.
If you can see a way to do this in more of a behaviour based way (using mixins / controllers I’d assume), that’d be great For editors, with a few tweaks to allow passing full objects to the cellRenderer, that felt do-able without touching the Grids internals, cell selection though didnt |
@jackofseattle no worries. and size is always important! |
@andreypopp On the main part of adding selection onto thegrid by click or keyboard, I've also done a attempt at a version as it feels more of a behaviour than anything else but had 2 key issues:
At the moment, a cell renderer gets the column and the value of your data object/array The (potential) issue I can think of here is working out should component update at the cell level, as without evaluating both the lens and isSelected() you can't tell. Let me know your thoughts on directions for this, as well as if it would help to break out this pr Cheers |
@@ -1,44 +0,0 @@ | |||
'use strict'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing ScrollShim
? On Mac OS X scrolling becomes flaky for some reason, ScrollShim
helped with that. Though maybe there's a better solution.
Given the grid has now changed since we have created our master, going to close this down and submit properly (ie feature based pull requests, not 1 big behemoth) |
Cleaned this up a bit, but the main changes are:
Structure / tooling
Features
Grid Navigation
ExcelGrid wraps the Grid component and adds keyboard navigation support
Toyed with a number of ways of doing this, but the one we've gone for here is:
Scrolling
Partly as a way to get the grid working in react 0.11.0, which broke in the context and child components (being descriptors) see
To make this all work, reduce complexity, and tweak some extra performance, got rid of the custom scrollbars, and revert to the Divs scroll
May have missed some crucial details, but in our tests this wouks well (bar a small issue on horizontal scroll keeping the headers in track #9)
Primarily this revolved around removing the scrollbar components, and the DOMMetrics mixin
Let me know if there are areas I misunderstood / it has introduced regressions
React v0.11.1
As above, upgrading broke the DomMetrics mixin, so I chopped it out
Tests
Added tests (runnable via gulp) and a jasmine testRunner.html file
had to hack the gulp task a little so that I could get browserify to pick up requires properly. We plan to migrate to webpack anyway, so will revisit that then
The tests are split into core and browser, with anything under core getting run in node (via gulp)
We're planning on plugging Jest in to get a fake DOM and then shoudl be able to make most tests run in browser OR in node, so we can have a watch that automatically reactifys, es6ifys, jshints, and runs tests
The tests so far are mostly on the keyboard nav side, but clearly lots of areas to add specs on for the main grid