Open les2 opened 7 years ago
Hi there,
I think this will be a solid addition to the table selection features. I'm not really too sure I understand the exact use case for the tab
stuff. I feel like the up
and down
keys should handle that no?
In my experience, the following work bests (with slight changes for Mac like Cmd-A selects all in multiple selection). I would love to have keyboard features. I think there should be a default mapping of keys to events but the default mapping should be configurable.
Navigation (changes the focused row with a visual clue often highlighting):
Multiple selection:
Single selection:
Notes:
update from a recent feature.
i disabled the built in ELT row selection in favor of a checkbox column with a header column with toggle select all checkbox for the following reasons:
note: it was not difficult to implement this. took about an hour, including updating tests, etc.
so an alternative to the current selection method is the checkbox column (assume it has extend selection enhancement i mentioned above and the up/down navigation system proposed by Scott).
thoughts? i can throw up example of this if it would aid the discussion - let me know.
I have the same need for keyboard support. However, I thought, too, about the checkboxes idea but they are a little old school for my taste (i.e. they were needed before the AJAX era but not anymore). Beside, they are slower than an "Excel style" selection where you can quickly select a large range of rows with the mouse. I like the suggestions of @ScottSmix for the navigation and selection.
Anyway, I will implement my thing, put up a demo and you guys tell me what you think.
Excellent! I am glad you are going to tackle this!
I agree that the checkboxes feel a little retro.
I too look forward to seeing your demo with keyboard support.
On Tue, Nov 22, 2016, 8:08 PM Pierre-Luc Carmel Biron < notifications@github.com> wrote:
I have the same need for keyboard support. However, I thought, too, about the checkboxes idea but they are a little old school for my taste (i.e. they were needed before the AJAX era but not anymore). Beside, they are slower than an "Excel style" selection where you can quickly select a large range of rows with the mouse. I like the suggestions of @ScottSmix https://github.com/ScottSmix for the navigation and selection.
Anyway, I will implement my thing, put up a demo and you guys tell me what you think.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/offirgolan/ember-light-table/issues/236#issuecomment-262412354, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBEYHwzORtn8_G_F9DCRi6CaPb-YCudks5rA5H9gaJpZM4KeYIW .
Sorry it has been a long time. I am working on it full time now. Should be ready anytime soon.
Demo: https://plcarmel.github.io/ember-light-table/#/rows/spreadsheet
I will prepare a PR soon.
Demo looking good! It is very much appreciated. A few notes from my perspective (based on my original suggestions):
Using keyboard navigation on a multiple row selection table, shouldn't the spacebar toggle row selection?
In the demo using the navigation keys (like cursor up or down) un-selects a row. I think that should only be the behavior on single row selection. In multiple row selection, the navigation keys should not automatically un-select a selected row (only spacebar should toggle).
I was trying to replicate the behavior of a spreadsheet because it is the behavior that I wanted to have in my app. However, I also did a heavy refactoring (but 100% backward compatible) to allow complete customization of the behavior of the keyboard and mouse. This way, we will be able to provide a large number of different behaviors to the users and they will be able to provide their own if the proposed behaviors do not suit them.
So, if you don't like the way it works, don't worry, it can be just one of many possible options.
One idea is to allow
tab
to focus on each row. While focused, anenter
(orspace
) press would select that row. If thectrl
/cmd
modifier is used when selecting, it would add/remove the row to the existing selection. Ifshift
modifier is used, it would select a range of rows.While a row is selected, the
up
anddown
arrows could move from one row to another (without activating them) -- this is where theshift
modifier would be useful.Row states:
tab
to focus the row); with a mouse, this is achieve via aclick
enter
while row wasfocused
; with a mouse, this is achieved aclick
up
ordown
to move between rows without focusing the row); with a mouse, this is achieve viahovering
I've built something like this before with angular and it wasn't too bad to implement (but I wasn't working with a general purpose table widget so I could use more hacks and dirty tricks that would be acceptable for a large project).
Would PRs implementing something like this be accepted? I don't really have a ton of time to focus on this right now but perhaps with a little guidance on implementation strategy me or someone else could take a stab at this.