Skip to content

Commit

Permalink
align name of the method
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Dec 20, 2024
1 parent 10273b1 commit 582010d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/demo/component/grid/grid-range-selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import '@vaadin/grid';
import '@vaadin/grid/vaadin-grid-selection-column.js';
import { html, LitElement } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import type { GridItemToggleEvent } from '@vaadin/grid';
import { getPeople } from 'Frontend/demo/domain/DataService';
import type Person from 'Frontend/generated/com/vaadin/demo/domain/Person';
import { applyTheme } from 'Frontend/generated/theme';
import type { GridItemToggleEvent } from '@vaadin/grid';

// tag::snippet[]
@customElement('grid-range-selection')
Expand All @@ -31,7 +31,7 @@ export class Example extends LitElement {
this.items = people;
}

private onItemToggle(event: GridItemToggleEvent<Person>) {
handleItemToggle(event: GridItemToggleEvent<Person>) {
const { item, selected, shiftKey } = event.detail;

// If the anchor point isn't set, set it to the current item
Expand All @@ -40,7 +40,7 @@ export class Example extends LitElement {
if (shiftKey) {
// Calculcate the range of items between the anchor point and
// the current item
const rangeStart = this.items.indexOf(this.rangeStartItem!);
const rangeStart = this.items.indexOf(this.rangeStartItem);
const rangeEnd = this.items.indexOf(item);
const rangeItems = this.items.slice(
Math.min(rangeStart, rangeEnd),
Expand Down Expand Up @@ -69,7 +69,7 @@ export class Example extends LitElement {
<vaadin-grid
.items="${this.items}"
.selectedItems="${this.selectedItems}"
@item-toggle="${this.onItemToggle}"
@item-toggle="${this.handleItemToggle}"
>
<vaadin-grid-selection-column></vaadin-grid-selection-column>
<vaadin-grid-column path="firstName"></vaadin-grid-column>
Expand Down

0 comments on commit 582010d

Please sign in to comment.