Skip to content
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

Add keyboard navigation of the grid #32

Closed
DrGriff opened this issue Nov 15, 2019 · 16 comments
Closed

Add keyboard navigation of the grid #32

DrGriff opened this issue Nov 15, 2019 · 16 comments

Comments

@DrGriff
Copy link

DrGriff commented Nov 15, 2019

Many of our users are very keyboard orientated and have mentioned that it would be nice to be able to use the up and down arrows to navigate the grid. Is that possible?

@gustavnavar
Copy link
Owner

I will add the up and down events to move between pages.

@DrGriff
Copy link
Author

DrGriff commented Nov 20, 2019

Maybe:

  • [Left] and [right] arrows to navigate between pages

  • [Home] to navigate to the first page

  • [End] to navigate to the last page

  • [Up] and [Down] to navigate from one row to another (if rows are selectable - guess first row would need to be selected by default)

@gustavnavar
Copy link
Owner

This feature will require .Net Core 3.1 because it's necessary to use event's propagation stop.

I will add a new branch for .Net Core 3.1 support.

@gustavnavar
Copy link
Owner

there is a new commit in the branch https://github.com/gustavnavar/Grid.Blazor/tree/net-core-3.1 including the keyboard navigation.

But no nuget package published yet.

@DrGriff
Copy link
Author

DrGriff commented Nov 28, 2019

Would you consider publishing the 3.1 version as a Beta NuGet package? Is your intention to replace the 3.0 version once 3.1 is fully released by Microsoft?

@gustavnavar
Copy link
Owner

My intention is to publish a preview of the 3.1 version today or tomorrow.

And I don't think that I will produce any other update to the version 3.0

@gustavnavar
Copy link
Owner

Nuget packages implementing this changes has been released. They are for .Net Core 3.1-Preview3

  • GridBlazor: 1.3.0-Preview3
  • GridMvcCore: 2.11.0
  • GridShared: 2.11.0

@DrGriff
Copy link
Author

DrGriff commented Nov 29, 2019

May I suggest one improvement that I think would really help?

If the ClientGrid is marked as .Selectable(true) then when the grid loads, the first row is automatically selected.

Current behaviour

  1. Page loads with Grid
  2. The [Up] and [Down] arrows don't work
  3. The user has to manually select one row using the mouse to get these arrows to work
  4. The user clicks the [Right] arrow, this moves us to the second page
  5. The [Up] and [Down] arrows again don't work without having to click the grid

This still requires a swapping between the keyboard->mouse->keyboard.

I guess there is a choice in how this should be implemented:

  1. The first row should automatically be selected when the page loads (unless the provided Grid State says otherwise)
  2. The .Selectable(true) could have a new optional parameter that can be set to "true" to control this
  3. A method is exposed that allows us to manually select a row, e.g. Select(int rowOrdinal)
  4. An alternative is for the consuming code to control this, allong the lines of this post

The concern would be if the automatic behaviour started to override other expected behaviour....

@gustavnavar
Copy link
Owner

GridBlazor 1.3.2 supports the configuration to automatically select the first row when a page loads.

There is a second parameter of the Selectable methos to control this behavior.

@dringwala
Copy link
Contributor

I have issue with Left and Right arrows for page navigation. I have more columns on grid that it can fit on screen. With that, if i use left or right arrows, page scrolls to left or right without realizing page control also changes to left or right. I have added ctrl qualifier to navigate pages.
This allows end user to scroll right or left on current page using arrow keys and also page switch using ctrl + [right/left] keys.
If you provide me access to create pull request, I can push my changes up.

@gustavnavar
Copy link
Owner

You should be able to create a pull request, it is not blocked.

@gustavnavar
Copy link
Owner

The new version of GridBlazor package (1.3.3) implements the following keyboard navigation:

  • [Ctrl] + [Left] and [Ctrl] + [Right] arrows navigate between pages
  • [Ctrl] + [Home] key goes to the first page
  • [Ctrl] + [End] key goes to the last page
  • [Ctrl] + [Up] and [Ctrl] + [Down] arrows navigate from one row to another for grids where rows are selectable
  • [Tab] key navigates among elements of a filter widget when it is visible
  • [Esc] key minimises a filter widget when it is visible
  • [Backspace] clear all filters

@TheGreenCedar
Copy link

This is low priority, but may I suggest using another sticky than [Ctrl], or provide the ability to override the bindings?

[Ctrl] + [Left]/ [Ctrl] + [Right] and [Ctrl] + [Backspace] are browser-implemented text editing bindings that allow to respectively skip a word backward/forward or delete the previous word

@gustavnavar
Copy link
Owner

GridBlazor 1.3.6 allows to change the modifier key used for keyboard navigation using the SetModifierKey method of the GridClient object:

    var client = new GridClient<Order>(HttpClient, url, query, false, "ordersGrid", Columns)
        .SetModifierKey(ModifierKey.ShiftKey);

The parameter options of the SetModifierKey method are:

  • ModifierKey.CtrlKey (default value)
  • ModifierKey.ShiftKey
  • ModifierKey.AltKey
  • ModifierKey.MetaKey

The last 2 options can collide with the modifier keys of the browser. The recommended options are ModifierKey.CtrlKey and ModifierKey.ShiftKey.

@gustavnavar
Copy link
Owner

Keyboard navigation currently has an impact on the grid behavior just after loading it. I someone want to leave his/her opinion, just add a comment on #63

@gustavnavar
Copy link
Owner

Versions before GridBlazor 1.3.9 had the keyboard navigation enabled by default. This feature requires to focus on the grid element, but it can create problems when used on pages with 2 or more grids. As a consequence, starting with version 1.3.9 it has to be explicitly configured for each grid that requires keyboard navigation. Users can enable keyboard navigation between pages using the SetKeyboard method of the GridClient object:

    var client = new GridClient<Order>( ... ).SetKeyboard(true);

The parameter default value is false.

gustavnavar added a commit that referenced this issue Feb 22, 2020
* Update documentation

* Add CRUD support

* Add Guid foreign keys with CRUD

* Update CRUD documentation

* Add ability to change the page size

* Add ability to change the page size

* Add keyboard navigation of the grid (#32)

* Grouping error when column value is null (#41)

* Improvements to filtering (#35)

* Update documentation 3.1

*  Update documentation 3.1

* Fixed Razor compilation errors when using .NET Core 3.1

* Add Css classes override for most important grid elements

* Added HasConstraint property to GridColumnBase

* Reset cached items count value when collection changes

* Fix gridblazor.min.css issue

* Fix compilation error in more components

* Fix drag error on Firefox and Edge (#41)

* Group by property, then sort groups by expression (#33)

* Group by property, then sort groups by expression (#33)

* Add HasConstraint property to GridColumn for MVC

* Provide overloaded RenderComponentAs() with async callbacks(#38)

* Update documentation

* Upgrade to .Net Core 3.1

* Fix issue when collapsing a group (#50)

* Use partial classes for razor pages

* Update documentation

* Update documentation

* Update documentation

* updated readme

* Changed page navigation to ctrl +[Right/Left Arrow key] instead of just Right/Left Arrow keys

* Updated Documentation for Keyboard Navigation commands

* Added Ctrl requirement for Home and End keys to navigate to first and last pages respectively

* Revert "updated readme"

This reverts commit 8dfefac.

* Added multi select capability

* added vscode directory to gitignore

* Updated documentation

* Added Selected Items propery

* updated documentation

* Add clear all filters functionality

* Update localization documentation

* Add multiselectable and Norwegian translation

* Fix bug #56

* Change keyboard modifier key

* Change keyboard modifier key

* Added type="button" to all <button> with no specified type to avoid making them a type="submit" buttons

* Remove Newtonsoft.Json dependency

* Update documentation

* Fix issue #61 and new GridMvcCore string resources

* Update package versions

* Correct parameter assignation

* Modify the  ChangeBool to reflect changes to value false in variable

* Set Id of the new ColumnOrderValue to the max Id plus 1

* Fix issue #63

* Update documentation

* Add list filters

* Add filters on hidden columns and grid events

* Added Turkish Language

* Added Turkish Language

* Add filters on hidden columns and grid events

* Validate that FieldName is not null  in case not mapped column exist

* Add Guid filter

* Validate that FieldName is not null in case not mapped column exist

* Update documentation

* Add method ReadonlyOnUpdate to columns

* Added GridCellCssClass
Added GridItemsCountCssClass

* Hide ReadonlyOnUpdate columns on create page

* Update documentation

* Add NotEqual filter (#79)

* Fix GridMvcCore Ajax currentPage value type

* Update Blazor demos

* Update Blazor demos

* Hide other filter widget when opening a filter #81

* ReadOnUpdate fields should not be hidden on Create.

* Consider case when both ReadOnlyOnUpdate and CrudHidden are used.

* Blazor WA 3.2.0 Preview 1 support

* Update GridBlazor version

* Allow ICustomGridComponent<> type argument to be interface of Grid data type. Addresses issue #53

* Minor fixes for GridBlazor filters and GridMvc pager

* Fix isssue #89

* Fix isssue #87

* Update GridBlazor in MVC demo

* Add Bootstrap 3.x css

* Add Czech translation

* Add DateTime picker and custom comparer sort

* Add nested CRUD

* punctual crud visibility

added punctual visibility for each CRUD mode.

Co-authored-by: Gustavo Navarro <30131949+gustavnavar@users.noreply.github.com>
Co-authored-by: Serhii Yolkin <serhii.yolkin@gmail.com>
Co-authored-by: Deval Ringwala <ringwala@lucasware.com>
Co-authored-by: Ricardo Pacheco <ricardo.pacheco.roldan@gmail.com>
Co-authored-by: İSMAİL KÖSE <kyzaghan@ismailkose.com.tr>
Co-authored-by: timbze <35117769+timbze@users.noreply.github.com>
rgentry09 added a commit to rgentry09/ERP-ASP.NET that referenced this issue Jul 10, 2023
dev0926 added a commit to dev0926/gridNET that referenced this issue Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants