-
Notifications
You must be signed in to change notification settings - Fork 155
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
Setting selection mode to disabled does not disable selection #401
Comments
Hi @doctor-g, The vaadin-grid rows have by default 3 different visual state indicators
Disabling row selection doesn't turn off row hover and focus but only the selection functionality. My guess is that in your case the row didn't actually get selected, but focused. Just verified it's working as it should at https://cdn.vaadin.com/vaadin-elements/latest/vaadin-grid/demo/selection.html (grid.selection.selected() always returns an empty array when selection is disabled) |
What you describe is sensible, although your intention and the user experience are quite different. It sure looks like I'm selecting a row when I click on it to give it focus---and it's that UX that I want to modify. Are there styles to disable the coloration on hover and focus? |
There's a mixin in vaadin-grid (--vaadin-grid-selected-row-cell) that applies to selected row cells and can thus be used to affect the appearance of selections. For removing the focus indicator, best option currently is to set the --primary-color to transparent for the vaadin-grid. Hover style is fixed so need to use /deep/ selector there for now to modify it. FYI: While examining the issue today, I bumped into a (vaadin-grid 1.1.0) regression with the row focus feature. As it doesn't function properly at the moment it's very understandable that it can be confused with row selection. To see how the focus row is supposed to be working (keyboard selection), see the demos of vaadin-grid 1.0.0. |
Thank you for your help! |
Implement tabindex. Fixes vaadin#401
The 'disabled' selection mode does not disable selection with the mouse. I have set the selection mode using
selection-mode="disabled"
in the HTML and viagrid.selection.mode="disabled"
in JavaScript. Mousing over rows highlights them, and clicking them selects them. I expected this to be turned off while selection-mode is disabled.Using vaadin-grid 1.1.0.
I have not verified the behavior on touch devices.
The text was updated successfully, but these errors were encountered: