sveltejs / learn.svelte.dev

A soup-to-nuts interactive tutorial on how to build apps with Svelte
https://learn.svelte.dev
MIT License
529 stars 243 forks source link

compiler warnings mess around with the cursor #323

Open Rich-Harris opened 1 year ago

Rich-Harris commented 1 year ago

Another placeholder issue like #322 — I've seen the cursor jump around in Chrome when there's invalid code in the editor

https://user-images.githubusercontent.com/1162160/230144511-5937a4bc-20ae-4890-8993-08b7d7810e69.mov

tomoam commented 1 year ago

This will no longer occur if either of the following is commented out.

https://github.com/sveltejs/learn.svelte.dev/blob/5cc3d078d098a4cf436509c69cdb4b5044655c7f/src/routes/tutorial/%5Bslug%5D/Editor.svelte#L40

https://github.com/sveltejs/learn.svelte.dev/blob/5cc3d078d098a4cf436509c69cdb4b5044655c7f/src/routes/tutorial/%5Bslug%5D/Editor.svelte#L133

I found a similar issue to this in the discuss of Codemirror.

https://discuss.codemirror.net/t/bizarre-tab-diagnostic-interaction/5207