Skip to content

Commit f41d84a

Browse files
authored
fix: Incorrect cursor position when resizing (#257)
1 parent dd15281 commit f41d84a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/bytemd/src/editor.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,14 @@
369369
editor && editor.focus()
370370
})
371371
}
372+
373+
if (v === 'write') {
374+
tick().then(() => {
375+
// https://github.com/bytedance/bytemd/issues/232
376+
// https://github.com/codemirror/codemirror5/issues/3270
377+
editor && editor.setSize(null, null)
378+
})
379+
}
372380
}}
373381
on:click={(e) => {
374382
switch (e.detail) {

0 commit comments

Comments
 (0)