Skip to content

Commit

Permalink
Added ESC listener to inline edit
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausSchaefers committed Jun 20, 2024
1 parent 4dff4da commit 6ae5a24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/canvas/InlineEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ export default {
}
if(!this._inlineEditStarted && this._inlineEditDiv){
// on ESC cancel editing, BUT save
this.setCanvasCancelCallback('inlineEditStop')
if(!this._inlineEditWidget.props.label &&!doNotEmptyOnNull){
this._inlineEditDiv.innerHTML = "";
Expand Down
11 changes: 8 additions & 3 deletions src/canvas/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ import * as SelectionUtil from 'core/SelectionUtil'
this.logger.log(-1,"onWidgetSelected", "enter > "+ id + " > ignoreParentGroups : "+ ignoreParentGroups);
const now = new Date().getTime()
const lastSelectedWidget = this._selectWidget ? this._selectWidget.id : null
/**
* Check here if the widget was select a second time. In this case
Expand Down Expand Up @@ -222,8 +221,14 @@ import * as SelectionUtil from 'core/SelectionUtil'
}
this.controller.onWidgetSelected(id);
// we continue the inline editing here, if another
// widget was in inline edit before
if ((now - this._inlineEditLastStop) < 300) {
this.inlineEditInit(this._selectWidget)
// Check, because otherwise the ESC listener might
// throw us back to inline editing the same widget
if (lastSelectedWidget !== id) {
this.inlineEditInit(this._selectWidget)
}
}
} else {
console.warn("onWidgetSelected() > No widget with id", id);
Expand Down

0 comments on commit 6ae5a24

Please sign in to comment.