diff --git a/lib/features/label-editing/LabelEditingProvider.js b/lib/features/label-editing/LabelEditingProvider.js index 54c31cd5..3aea069a 100644 --- a/lib/features/label-editing/LabelEditingProvider.js +++ b/lib/features/label-editing/LabelEditingProvider.js @@ -49,7 +49,8 @@ export default function LabelEditingProvider( 'drag.init', 'element.mousedown', 'popupMenu.open', - 'root.set' + 'root.set', + 'selection.changed' ], function(event) { if (directEditing.isActive()) { diff --git a/test/spec/features/label-editing/LabelEditingProviderSpec.js b/test/spec/features/label-editing/LabelEditingProviderSpec.js index e4e26ac8..5d99cec3 100644 --- a/test/spec/features/label-editing/LabelEditingProviderSpec.js +++ b/test/spec/features/label-editing/LabelEditingProviderSpec.js @@ -127,7 +127,7 @@ describe('features - label-editing', function() { )); - it('should submit on root element click', inject( + it('should complete on root element click', inject( function(elementRegistry, directEditing, canvas, eventBus) { // given @@ -156,7 +156,7 @@ describe('features - label-editing', function() { )); - it('should submit on root element changed', inject( + it('should complete on root element changed', inject( function(elementRegistry, directEditing, canvas, eventBus) { // given @@ -183,6 +183,26 @@ describe('features - label-editing', function() { } )); + + it('should complete on selection changed', inject( + function(elementRegistry, directEditing, selection) { + + // given + var shape = elementRegistry.get('Task_1'), + task = shape.businessObject; + + directEditing.activate(shape); + + directEditing._textbox.content.textContent = 'FOO BAR'; + + // when + selection.select(); + + // then + expect(task.name).to.equal('FOO BAR'); + } + )); + });