1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Browser Undo Breaks With Custom Event Handler

Discussion in 'JavaScript' started by Heretic86, Aug 6, 2021.

  1. #1
    Vanilla Javascript...

    Hopefully pretty easy. I have a Text Area that I use a custom Event Handler in to modify the pasted content.

    function doPasteThang(e){
    e.preventDefault();

    //... some code here

    myTextArea.value = modifedString;
    }

    So that all works. However, once something has been pasted, I can no longer use a Browsers CTRL + Z to Undo the last thing entered. I am missing something, and not really sure what I am missing. Like a mutation? new CustomEvent?

    Can anyone suggest what I am missing?
     
    Heretic86, Aug 6, 2021 IP