Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: demo + modeler example: if editing text followed by saveXML, the new text is missing in the xml #2197

Closed
c-antin opened this issue Jun 25, 2024 · 6 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@c-antin
Copy link

c-antin commented Jun 25, 2024

Describe the Bug

if editing text followed by saveXML, the new text is missing in the xml

Steps to Reproduce

  1. goto https://demo.bpmn.io/
  2. append a task
  3. double click to edit text
  4. add text
  5. click download xml button
  6. re-import xml
  7. observe missing text

Expected Behavior

editing text should trigger change event.
Or is there a way to trigger change before saving xml?
Note: every non-text action (e.g. click on elements) seems to trigger change.

Environment

  • Browser: Chrome 126
  • OS: Win 10
  • Library version: bpmn-js 17.8.3
@c-antin c-antin added the bug Something isn't working label Jun 25, 2024
@philippfromme
Copy link
Contributor

Did you actually confirm the label editing though Enter or clicking outside of the element? If you don't do that before downloading the XML the label will be missing.

@philippfromme
Copy link
Contributor

A screencast demonstrating your issue would be helpful.

@c-antin
Copy link
Author

c-antin commented Jul 2, 2024

Did you actually confirm the label editing though Enter or clicking outside of the element? If you don't do that before downloading the XML the label will be missing.

I was of the impression that editing text without clicking outside would be enough to register the change.
I guess it's more of an inconvenience than a bug, then?

@barmac
Copy link
Member

barmac commented Jul 16, 2024

I can reproduce the issue. However, I don't think it's likely that we look into this. If you want to solve it on your own, you can call modeler.get('directEditing').complete() before modeler.saveXML() is executed.

@barmac barmac closed this as completed Jul 16, 2024
@barmac barmac added the wontfix This will not be worked on label Jul 16, 2024
@c-antin
Copy link
Author

c-antin commented Jul 16, 2024

Thanks for pointing me to directEditing! Since saveXML is async, I save on 'commandStack.changed'. So sadly calling complete() does not help here!
Do you think it's a good idea to listen for keyup and calling complete() then?

edit: I tested it real quick: it's not a good idea, because it removes text focus...

@barmac
Copy link
Member

barmac commented Jul 16, 2024

Have you tried to complete the direct editing when saveXML.start event is fired. This way you complete only once, and right before the XML serialization is performed.

For further questions regarding your project, please head to the bpmn.io forum.

@barmac barmac reopened this Jul 16, 2024
@barmac barmac closed this as not planned Won't fix, can't repro, duplicate, stale Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants