undate
Undoable update for HTMLTextAreaElement
Install
npm install --save undate
Usage
; const textareaElement = document; textareaElementvalue; //=> '' // Update whole value; textareaElementvalue; //=> 'string before cursoroptional string after cursor' // Update around the cursor; textareaElementvalue; //=> 'string before cursor __ optional string after cursor' // Press cmd-z textareaElementvalue; //=> 'string before cursoroptional string after cursor' textareaElement; textareaElementvalue; //=> 'string before cursoroptional string after cursor' // ^^^^^^^^^^^^^^ selected ; textareaElementvalue; //=> 'string before **cursoroptional** string after cursor' // ^^^^^^^^^^^^^^ selected // Press cmd-z textareaElementvalue; //=> 'string before cursoroptional string after cursor' // ^^^^^^^^^^^^^^ selected // Press cmd-z textareaElementvalue; //=> ''
License
The MIT License