Skip to content

Commit

Permalink
Merge pull request #673 from revolist/cell-edit-event
Browse files Browse the repository at this point in the history
feat: cell edit catch on parent level
  • Loading branch information
revolist authored Jan 15, 2025
2 parents bfd7dd4 + 5c81e24 commit 6916c62
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs
Submodule docs updated 222 files
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions src/components/overlay/revogr-overlay-selection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -543,18 +543,6 @@ export class OverlaySelection {
editCell.x,
this.editors,
)}
onCloseedit={e => this.closeEdit(e)}
onCelledit={e => {
const saveEv = this.beforeCellSave.emit(e.detail);
if (!saveEv.defaultPrevented) {
this.cellEdit(saveEv.detail);
}

// if not clear navigate to next cell after edit
if (!saveEv.detail.preventFocus) {
this.focusNext();
}
}}
/>
);
}
Expand Down Expand Up @@ -613,6 +601,18 @@ export class OverlaySelection {
onDblClick={(e: MouseEvent) => this.onElementDblClick(e)}
onMouseDown={(e: MouseEvent) => this.onElementMouseDown(e)}
onTouchStart={(e: TouchEvent) => this.onElementMouseDown(e, true)}
onCloseedit={(e: CustomEvent<boolean | undefined>) => this.closeEdit(e)}
onCelledit={(e: CustomEvent<SaveDataDetails>) => {
const saveEv = this.beforeCellSave.emit(e.detail);
if (!saveEv.defaultPrevented) {
this.cellEdit(saveEv.detail);
}

// if not clear navigate to next cell after edit
if (!saveEv.detail.preventFocus) {
this.focusNext();
}
}}
>
{nodes}
<slot name="data" />
Expand Down

0 comments on commit 6916c62

Please sign in to comment.