Ctrl Z and document.execCommand
<p>On Safari, I am pasting text into an editable textarea. When I execute <code>document.execCommand("undo", false, null)</code> nothing happens, and the text appears with extra line breaks.</p>

<p>I have to manually press Ctrl-Z to erase the text.</p>

<p>On subsequent attempts, when I execute <code>document.execCommand("undo", false, null)</code>, the text appears exactly as it does in the source document AND the text is erased!</p>

<p>It doesn't work the first time, but it does on all subsequent attempts <strong>AFTER</strong> I
first manually press Ctrl-Z.</p>

<p>I really need <code>document.execCommand("undo", false, null)</code> to work on <strong>ALL</strong> attempts, not just starting with the second one.</p>

<p>Does anyone have any experience with this problem who knows a solution?</p>
