Hi @jcfisher007 (@FormBucketSupport ),
also related to #2
I was expecting to be able to bind the CodeMirror's value like so
<script>
let value = "fooo";
let cm2;
</script>
<div class="codemirror-container flex">
<CodeMirror bind:this={cm1} bind:value={value} />
<br>
<CodeMirror bind:this={cm2} {value} />
<br>
<button on:click="{ () => { value += value + '1'; cm2.update(value); console.log(value); }}" >Press me!</button>
</div>
But then I found your comment
// We have to expose set and update methods, rather
// than making this state-driven through props,
// because it's difficult to update an editor
// without resetting scroll otherwise
Correct me if I'm wrong, but this means that it is the parent component's responsibility to import and subscribe on:change, as well as set and update?
Many thanks,
F
Hi @jcfisher007 (@FormBucketSupport ),
also related to #2
I was expecting to be able to bind the CodeMirror's value like so
But then I found your comment
Correct me if I'm wrong, but this means that it is the parent component's responsibility to import and subscribe
on:change, as well as set and update?Many thanks,
F