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

Format button breaks undo #54

Open
broady opened this issue Aug 11, 2016 · 2 comments
Open

Format button breaks undo #54

broady opened this issue Aug 11, 2016 · 2 comments
Labels

Comments

@broady
Copy link

broady commented Aug 11, 2016

To reproduce:

  1. Go to http://www.gopherjs.org/playground
  2. De-indent the three lines in main
  3. Press "Format"
  4. Ctrl-Z repeatedly

What I see:

Corrupted text.

What I want to see:

Ctrl+Z undoes formatting, then continues to undo previous operations.

/cc @francesc

@dmitshur
Copy link
Member

dmitshur commented Aug 12, 2016

Thanks for reporting this with clear reproduce steps.

I can reproduce this both on http://www.gopherjs.org/playground/ AND on https://play.golang.org/ in latest stable version of Chrome.

image

The code for applying formatting is very straightforward, it simply overwrites the entire <textarea> content with the new formatted code.

Given that it's also a bug on the official Go Playground, I suspect it's a browser thing. Whatever the fix is there is likely to be applicable here as well.


Okay, I just tried the same steps in Firefox, and the issue does not occur there. It undoes the formatting and edits before it without issues.

So, given it's a browser bug (that's likely to be fixed in the future) and not a bug specific to GopherJS Playground, it should be reasonable to close this, right?

It's probably also a good idea to make a small repro case and submit a bug report to Chrome project, if it's not already a known/reported bug.

@dmitshur
Copy link
Member

dmitshur commented Aug 12, 2016

Tested in latest stable Safari (Version 9.1.2 (11601.7.7)) and the bug happens there too (on both playgrounds). So I suspect it might be a long-standing WebKit issue (and probably already reported, but not easy to fix).

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

No branches or pull requests

2 participants