question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Save issue - saves fine, but won't allow a second "save"

See original GitHub issue

Hi - thanks for the great library! When I listen to the “saved” event, it triggers successfully, but it seems the tools stop listening. (I can no longer hilight and edit). If I trigger save a second time, I get

Uncaught TypeError: Cannot read property 'removeAttribute' of null
    at c.unmount (contentTools.js:110)
    at c.save (contentTools.js:113)
    at HTMLElement.sb.onclick (contentTools.js:946)
c.unmount @ contentTools.js:110
c.save @ contentTools.js:113
sb.onclick @ contentTools.js:946

Even if I just return without doing anything this happens. For example:

editor.addEventListener('saved', async function (ev) {
        var name, payload, regions, xhr, template;
        return true;
    });

Is the API expecting a return code or some sort of trigger to indicate success and return to an editable state?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chronofishcommented, Apr 29, 2020

YES! Thank you! that was a super easy fix!

0reactions
anthonyjbcommented, Apr 29, 2020

Ah OK so you have a custom save button - no worries but this explains why the editors state is getting out of wack.

So if your save button is passive (as in you want the button to save the document but not exit the editing mode) then when you call save flag that you want this to be a passive save save(true).

However, if you want the save button to save the changes and exit edit mode then you need to stop the editor, something like:

editor.ignition().state('ready')
editor.stop(true)

Let me know if that helps out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

You may receive a "Your changes could not be saved" error ...
This issue occurs if Excel cannot delete the original file or cannot rename the temporary file so that the save operation cannot successfully...
Read more >
Why am I unable to save a file on my computer?
It can be frustrating when you're using a computer program and can't save a file you're creating or modifying.
Read more >
Troubleshoot issues with saving files - Adobe Support
Experiencing issues while saving a file in Illustrator? Here are some troubleshooting steps that you can try.
Read more >
"One or more objects in this drawing cannot be saved to the ...
Issue : When trying to save a drawing in AutoCAD, the following message is displayed: AutoCAD Message. One or more objects in this...
Read more >
How to Fix Documents Not Saving on macOS 10.15
If you can't save a document using Word for Mac OS 10.15 due to an error message that states that “the document cannot...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found