Skip to content

Commit 8944ca3

Browse files
committed
fix: cursor jumps when editing definition properties
When definition properties are edited it fires `Modeling#updateProperties`. This method fires command `element.updateProperties` via commandStack to update element, same time `DrdUpdater` is subscribed to this command and do `DefinitionPropertiesView#update` when it executed. When `DefinitionPropertiesView#update` is called it updates textContent of corresponding elements unconditionally which leads to cursor jump. In order to workaround issue with jumping cursor I've added condition that checks if element currently in focus and if so it prevent update of element content Fixes #951 Fixes #274
1 parent fff4937 commit 8944ca3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/dmn-js-drd/src/features/definition-properties/DefinitionPropertiesView.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,13 @@ DefinitionPropertiesView.prototype._init = function() {
6868
DefinitionPropertiesView.prototype.update = function() {
6969
var businessObject = this._canvas.getRootElement().businessObject;
7070

71-
this.nameElement.textContent = businessObject.name;
72-
this.idElement.textContent = businessObject.id;
71+
if (document.activeElement !== this.nameElement) {
72+
this.nameElement.textContent = businessObject.name;
73+
}
74+
75+
if (document.activeElement !== this.idElement) {
76+
this.idElement.textContent = businessObject.id;
77+
}
7378
};
7479

7580

0 commit comments

Comments
 (0)