Editable Text Elements with state changes

When I create a widget with an editable text element, I can change the text in the prototype.
However, if this widget changes its state, the text element is reset to its original content (as shown in screenshots).

-widget in “view”-mode

-Widget in “edit”-mode

Is there a way to set the edited text as the new content?