Loss of focus when updating node name

i am trying to give the user the following script
-Create any of the nodes
-Set a name for the node using the bpmn default behavior (when creating a new node, the input field is autofocused)

  • then the user must configure the node using my right options panel
  • at the end of the setup, the user clicks on the next node (from the Context panel)
  • the chain is repeated

The essence of the problem: the error occurs at the time of the introduction of a name for a new node and the transition to work with my options panel.
When changing any of the fields,
I execute:

const modeling = modeler.get('modeling')
        modeling.updateProperties(element, {
            'custom:modelType': event.target.value,

As a result, my node loses focus, and the name entered earlier is not saved. It seems to me that I was able to understand what was happening, the parameter update event occurs before the node name value save event

  1. trigger the ‘element.updateLabel’ event and save the name before executing the piece of code I attached above
  2. set up blur for node input element when my panel is clicked

please help, i will be grateful for any help

Can you attach a screen recording of what’s happening?