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 option for single-click edit toggle #73
Comments
I would recommend making this opt-in via Implementation notes:
Note: this has to be fixed in #72 |
I’m trying to figure out the different modes of the grid and how they might affect this. There are two modes for the grid as a whole (applies to the normal Grid component as well):
In Grid Pro, the editable column cells have two modes:
Instead of something like Then it would always be directly editable by clicking on it. Also, the whole grid should change to the interactive mode in that situation (when a cell in edit mode is focused), so that Tab-navigation works as expected (skipping over non-editable cells). Having a user focus any cell in edit mode would change the whole grid to interactive mode (and the user can exit back to navigation mode by pressing Esc). Compare that to the “Crud Demos” example for the normal Grid. Press the edit button on one row, and then you have that row in “edit” mode vs the other rows in presentation mode. The normal Grid has quirks/bugs how it moves between the navigation and interactive modes, and we should address those at the same time. The idea isn’t completely clear, but to me, it seems it could use a bit more consideration. I think one of my concerns is that is it going to be strange for a user to click on a textual element which will then change into a completely different component like a checkbox? Also, with something like |
This sounds like a very good idea to me, since it's more in line with the way developers want a fully-editable grid to work, and the way in which users want to use it. It could also solve the issue of affordance/discoverability of editable cells, especially if cells in edit mode would be clearly distinguish visually. |
The only guidance we had while working on the initial release was "when in doubt, align with how Google spreadsheet works". Having edit mode enabled by default would produce a need for significant refactoring, but I agree it kinda makes sense for some of the use cases. Please keep in mind the "password" column behavior described at https://github.com/vaadin/vaadin-grid-pro/issues/71#issuecomment-473258194 |
A workaround that may work for some cases:
|
I'm using @mhosio s solution and it's working great. I'd really like to see this as something that would be possible to do from Java without needing any JavaScript code at all, it just feels dirty and it may possibly fail if the client-side code changes. It would really be great to see GridPro behave similar to Google Sheets, as @web-padawan mentioned. Is there any progress regarding that? |
No actual progress at the moment, but GridPro is up for some refactoring in the next few months anyway, so we'll see if this feature can be included in that work. |
Assuming we'll go with the single-click edit switch option, here are some detail regardin potential dilemmas involved: How will it work together with single-select (which also works with a click anywhere on the row)? How will it work together with row-details (which are also toggled on/off with a click anywhere on the row)? Should select-type editors automatically open the dropdown when edit mode is triggered? Will it be strange for a user to click on a textual element which then changes to something else like a checkbox? Other considerations
|
Separate ticket for radio button column feature mentioned above: https://github.com/vaadin/vaadin-grid/issues/1780 Separate ticket for row-details toggle column feature mentioned above: https://github.com/vaadin/vaadin-grid/issues/1781 Separate ticket for Lumo+Material styling for visually distinguishing editable cells: https://github.com/vaadin/vaadin-grid-pro/issues/127 |
Draft implementation at 18716d1 The behavior and naming still need some more discussion. |
|
Acceptance CriteriaAs an end user Acceptance criteria
General criteria
|
Add ability to make cell edition to be performed on a single click part of #73 Co-authored-by: Tomi Virkki <virkki@vaadin.com>
Add API to enable edit mode to Grid Pro with a single click on the cell. Fix vaadin/vaadin-grid-pro#73
Add API to enable edit mode to Grid Pro with a single click on the cell. Fix vaadin/vaadin-grid-pro#73
Currently the user has to doubleclick a cell to switch it to edit mode. This is problematic for a number of reasons:
I realize that a single-click toggle interferes with selection, but in many cases where heavy inline editing is needed, selection is a lesser concern, and can be provided by other means than a click anywhere in the row, e.g. using a selection column, an uneditable first column, or by providing row-specific functions with in-row buttons or a context menu instead, so I feel that having single-click editing as an option would be very valuable even with this caveat.
The text was updated successfully, but these errors were encountered: