From 24e4a9fc4b75dc46f4fe5080d4266a2779de42a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 29 Mar 2019 13:13:36 +0100 Subject: [PATCH] fix: fix issue with wrong editor content when changing sample --- src/playground.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/playground.js b/src/playground.js index 5c74afc6..7c546f93 100644 --- a/src/playground.js +++ b/src/playground.js @@ -85,7 +85,12 @@ class Playground extends Component { setSample(ev) { const sample = SAMPLES.find(s => s.description === ev.target.value); - this.editor.setValue(sample.code, -1); + this.updateState({ + js: sample.code, + css: "", + xml: "" + }); + this.editor.setValue(this.state[this.state.currentTab], -1); } updateStateFromEditor() {