-
Notifications
You must be signed in to change notification settings - Fork 67
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
feat: add ClientItemToggleEvent to notify when user toggles an item #6884
Conversation
b5d5026
to
fce4344
Compare
@@ -388,7 +388,7 @@ void select(GridTRElement row) { | |||
CheckboxElement checkbox = wrapElement(cell.getFirstChildElement(), | |||
getCommandExecutor()).wrap(CheckboxElement.class); | |||
if (!checkbox.isChecked()) { | |||
checkbox.click(); | |||
checkbox.getWrappedElement().click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In TestBench, the click()
method is overridden to use the JS click()
function, which doesn't fully simulate a complete mouse action. We need to use the real simulation to trigger mousedown
that will set _shiftKeyDown
.
...ent/vaadin-grid-flow/src/main/java/com/vaadin/flow/component/grid/ClientItemToggleEvent.java
Outdated
Show resolved
Hide resolved
...ent/vaadin-grid-flow/src/main/java/com/vaadin/flow/component/grid/ClientItemToggleEvent.java
Outdated
Show resolved
Hide resolved
…din/flow/component/grid/ClientItemToggleEvent.java Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
...rid-flow/src/main/resources/META-INF/resources/frontend/vaadin-grid-flow-selection-column.js
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
Description
The PR adds a new event
ClientItemToggleEvent
that fires when the user selects or deselects an item in the grid. The event provides information about the item, its selected state, and whether Shift was pressed during selection. The main purpose of this new event is to enable developers to implement features like range selection. The below example demonstrates how to implement range selection with behavior similar to Gmail:Depends on
Part of vaadin/web-components#8142
Type of change