Comments (14)
Attached are designs that include patterns for single/batch actions in a datagrid. We'd love to hear any feedback on this before we build it in Clarity. Thanks in advance!
datagrid_actions.pdf
datagrid_SingleBatch_actions.mov.zip
from clarity.
This is very concerning from an adoption standpoint. Single selection for datagrids is pretty standard behavior and is handled quite uniformly across libraries. It doesn't appear VMware is eating their own dogfood given vSphere's HTML5 fling has plenty of datagrids with single selection (see attached). I'll back up what zivanov said and say selection should be done on click, and we should be able to set an initial selected row programatically. I appreciate your initial design though, hope you revise it based on the feedback.
from clarity.
So there has been some discussion about this, and we're looking into maybe providing an option for the "full-row click" behavior many of you describe. Here is a plunker of a quick version of it, feasible right now with the current Clarity: https://plnkr.co/edit/OuZ3w6AecL4VvSXRd9sd?p=preview
It still has a few quirks, like the mouse not becoming a pointer, but that's the basic idea.
We're looking into potentially making this a simple one-line option, but it would rely on an informal contract that you would never put any additional click targets (like buttons or links) inside the rows themselves. We have no way of detecting this, so if you did end up putting click targets, you'd probably end up with a broken behavior. But offering both options (full-row click with no sub-targets, and the solution proposed in the previous comments) is something we are considering.
from clarity.
@yenmade could you provide some UX input here on the pattern to be used for single row selection/action in a datagrid?
from clarity.
I will be looking at this alongside other datagrid items.
from clarity.
-
This does not seem as single object selection. It would be better if we have selection not based on checkboxes, but on row click.
-
Is the three dots button intended to replace the right click of an item ?
-
Also it will be of great use to have support for CTRL + click, SHIFT + click, CTRL/SHIFT + KEY UP/DOWN for multiple selection.
from clarity.
@zivanov123 thanks for your feedback. Some comments below:
This does not seem as single object selection. It would be better if we have selection not based on checkboxes, but on row click.
Having selection on row click wouldn't be a solution in the case you have click targets within that row (imagine you have input fields, flat buttons, or any other click targets). When a user clicks are they clicking on the row or that other click target?
Is the three dots button intended to replace the right click of an item ?
It is intended to provide the ability to add actions to a row.
Also it will be of great use to have support for CTRL + click, SHIFT + click, CTRL/SHIFT + KEY UP/DOWN for multiple selection.
Keyboard support is pretty important and a good suggestion. CC @yenmade and @youdz to make sure they can take a look and see what needs to be done for keyboard support.
from clarity.
Having selection on row click wouldn't be a solution in the case you have click targets within that row (imagine you have input fields, flat buttons, or any other click targets). When a user clicks are they clicking on the row or that other click target?
In such cases these clickable targets will be with higher priority. Does not seem as an issue which has no solution.
Thanks!
from clarity.
@zivanov123 the challenge is not only technical it is also a user experience challenge that we need to be careful about. We don't want to have click targets with different priorities on the same area for the user to figure out what to click, where, and when to get what they need. Hope that makes sense.
from clarity.
IMO what needs to be done is to have a story for master/details, allow for keyboard navigation, and allow multiple selection for mass actions. A good model is the Gmail messages list:
a) When a message is clicked it gets the focus, gets colored differently (yellow in my case) and its details get shown in the preview pane
b) Keyboard navigation (up/down arrow) allows to move the focus between items
c) User can select one or more items using the check boxes in front of messages. When one or more items are selected any item focus is lost, hence details pane becomes empty (with a link to clear the selection).
d) When an item is clicked the focus is regained by that item, and the selection of items (if any) is cleared.
from clarity.
@ductor we're actually considering summary/detail behavior as part of our overall design patterns so the above is very useful. Thanks for sharing! cc @yenmade
from clarity.
@youdz I don't understand why having click targets in the selectable row would cause broken behavior? In some cases, you would want to provide a link to take the user to a different route on click, but still allow row selection if the user clicked on some other part of the row. It would be up to the developer to ensure they called e.stopPropagation() in their click handler if they didn't want the row to be selected as well.
There are most definitely usability issues with click targets in selectable rows (especially on mobile/touch devices), but I don't see a technical reason why it isn't possible.
where clicking on the VM's name will take the user to the summary page and clicking elsewhere on the row will select it and show the slave view below the grid.
from clarity.
@elesueur: Having a link inside a clickable row is basically putting a button in a button. Not only is this not W3C-compliant, but it's also generally bad experience for the user. A one-pixel misclick and you end up performing an action you didn't want.
Regarding e.stopPropagation()
, it's generally something you really want to avoid. Doing so will break other components that rely on the bubbling up of the event. For instance, a dropdown listening to all clicks on the page to close down. If the click happens to be on a datagrid element where you stop propagation, the dropdown doesn't close.
So overall, sure, there is always a technical way of doing it, but not only we won't support it, we also really advise against doing it.
from clarity.
Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.
from clarity.
Related Issues (20)
- [clr-datagrid] Details pane throws change detection error HOT 2
- [clr-datagrid] focus issues when details pane is opened HOT 4
- add reset all filter option in datatable HOT 4
- The detailButton of Clarity Datagrid Row is with wrong type in the datagrid-row.d.ts HOT 3
- Source map error and webpack 5 HOT 1
- cannot work updateFilterValue with custom filters HOT 4
- Icon 'script-execute' and 'script-schedule' not in icon/index.js HOT 4
- Attaching change event listener on Toggle
- White space after filter is applied. HOT 4
- Documentation for read-only missing HOT 2
- Read-only attribute not working for select-input component HOT 2
- Lack of badge for namespaces icon HOT 4
- Datagrid pageSize is not saved to localestore after page refresh HOT 2
- clrDgSelected on DatagridRow behaves inconsistently HOT 5
- Publish as Ivy Distribution HOT 3
- clr-ui uncompiled sass variable HOT 1
- Website navigation child of section expands a section on first click HOT 1
- CdsDropdown throws an exception in jsdom HOT 3
- Possible missing @clr/core 4.0.16? HOT 1
- Why is this repository archived?
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 clarity.