fix: fix issue with wrong editor content when changing sample

This commit is contained in:
Géry Debongnie
2019-03-29 13:13:36 +01:00
parent 2cabdf8d5c
commit 24e4a9fc4b
+6 -1
View File
@@ -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() {