I am not sure how this happens, but I think that this bug happens when the view switch is made during translation between code and script. Indeed, for small scripts (10 - lines) the problem doesn't seem to appear but on larger scripts (30+ lines) the problem occurs often.
Steps to reproduce the behavior:
- Copy paste a long enough script in the makecode editor
- switch from script view to block view, switch fast enough again on the script view and then again on the block view : the simulator must not have finished loading during this phase
- Code should be gone
I am not sure how this happens, but I think that this bug happens when the view switch is made during translation between code and script. Indeed, for small scripts (10 - lines) the problem doesn't seem to appear but on larger scripts (30+ lines) the problem occurs often.
Steps to reproduce the behavior: