Enterprise Data Grid & UI Components for Angular, React & Blazor Forums Editor & Inputs Anyone know if there’s a known bug with: Editor?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #113445
    alex.morris22
    Participant

    How do I enable autosave with Smart Editor?

    #113468
    admin
    Keymaster

    Hi,

    You can do this:

    const editor = document.querySelector(‘smart-editor’);

    let timeout;
    
    editor.addEventListener('change', () => {
      clearTimeout(timeout);
    
      // debounce (wait 1s after user stops typing)
      timeout = setTimeout(() => {
        const content = editor.getValue();
    
        // save somewhere (API or localStorage)
        saveContent(content);
      }, 1000);
    });
    
    function saveContent(data) {
      console.log('Autosaving...', data);
    
      // Example: send to backend
      // fetch('/save', {
      //   method: 'POST',
      //   body: JSON.stringify({ content: data })
      // });
    }

    Best regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.