fix: complete direct editing on selection changed

Related to https://github.com/camunda/camunda-modeler/issues/2961
This commit is contained in:
Philipp 2022-05-17 14:43:02 +02:00 committed by fake-join[bot]
parent 9b1096abbc
commit 011f394d05
2 changed files with 24 additions and 3 deletions

View File

@ -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()) {

View File

@ -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');
}
));
});