From f62905368b67922f81b35ba40e86d1b1a8148fa1 Mon Sep 17 00:00:00 2001 From: Halil Focic Date: Sat, 9 Nov 2024 17:09:40 +0100 Subject: [PATCH] fix: allow the edit inside the editing story example (#544) Properly editable is not being set by default for cells, hence the editing was never allowed to start. Major issue that was also present inside the mxGraph old example was that the value doesn't actually get updated. This commit fixes that as well. Furthermore, the container for the textarea editing had position relative instead of absolute which caused snappy behaviour while editing. --- packages/core/src/view/handler/CellEditorHandler.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/core/src/view/handler/CellEditorHandler.ts b/packages/core/src/view/handler/CellEditorHandler.ts index 86bdf2a34d..cb53c0e646 100644 --- a/packages/core/src/view/handler/CellEditorHandler.ts +++ b/packages/core/src/view/handler/CellEditorHandler.ts @@ -312,7 +312,7 @@ class CellEditorHandler implements GraphPlugin { this.textarea.style.minHeight = '1em'; } - this.textarea.style.position = 'relative'; + this.textarea.style.position = 'absolute'; this.installListeners(this.textarea); } @@ -854,7 +854,6 @@ class CellEditorHandler implements GraphPlugin { const initial = this.initialValue; this.initialValue = null; this.editingCell = null; - this.trigger = null; this.bounds = null; textarea.blur(); clearSelection(); @@ -882,7 +881,7 @@ class CellEditorHandler implements GraphPlugin { } }); } - + this.trigger = null; // Forces new instance on next edit for undo history reset if (this.textarea) InternalEvent.release(this.textarea);