Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo and Redo Stacks #2

Open
chrisbaldwinj opened this issue Oct 11, 2015 · 0 comments
Open

Undo and Redo Stacks #2

chrisbaldwinj opened this issue Oct 11, 2015 · 0 comments

Comments

@chrisbaldwinj
Copy link

The issue I am having is the no possible method of undo and redo methods after inserting using

c.setText = function(a, b) {
            var c = g(a)
              , d = a.value;
            a.value = d.slice(0, c.start) + b + d.slice(c.end); //issue is here!
        };

The problem I found is that by setting the value it leaves the undo stack alone. Unless we use

document.execCommand("insertText", false, d.slice(0,c.start) + b + d.slice(c.end));

This method will have a undo effect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant