Description
Describe the problem
When you edit a file in the editor, selected
class is removed from the file in the filetree (only happens on first edit).
selected_class_is_removed.2.mov
- Reproduction
- visit a tutorial like https://learn.svelte.dev/tutorial/your-first-component
- Edit a file in the editor
This is caused by comparing file
with $selected
(i.e., these may refer to different objects with the same contents).
When you open a tutorial page, deep copy of stub
(file) is created...
learn.svelte.dev/src/routes/tutorial/[slug]/Editor.svelte
Lines 190 to 195 in 9c9656b
...then, if you edit a file, change
event will be dispatched, and file
will be updated to deep copy of the one.
learn.svelte.dev/src/routes/tutorial/[slug]/Editor.svelte
Lines 210 to 213 in 9c9656b
learn.svelte.dev/src/routes/tutorial/[slug]/+page.svelte
Lines 390 to 395 in 9c9656b
learn.svelte.dev/src/routes/tutorial/[slug]/+page.svelte
Lines 196 to 209 in 9c9656b
Describe the proposed solution
Comparing with the respective name
property instead.