svelte
                                
                                 svelte copied to clipboard
                                
                                    svelte copied to clipboard
                            
                            
                            
                        fix: `onDestroy` runs after the component is detached from DOM
Fix: #7888 The idea is if there is a parent node instead of push, append an item to the first, and in the case of nested components, the last child will be at the first index.
Before submitting the PR, please make sure you do the following
- [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
- [x] Prefix your PR title with [feat],[fix],[chore], or[docs].
- [x] This message body should clearly illustrate what problems it solves.
- [x] Ideally, include a test that fails without this PR but passes with it.
Tests
- [x] Run the tests with npm testand lint the project withnpm run lint
I will close or review this PR after solving this comment. https://github.com/sveltejs/svelte/issues/7888#issuecomment-1336298623
@baseballyama is attempting to deploy a commit to the Svelte Team on Vercel.
A member of the Team first needs to authorize it.
@RaiVaibhav I went back to this PR and issue, and now I got this properly. (Sorry for late understanding🙏) I refactor this PR and format test.
Hey @dummdidumm let me know if I can help here anyhow
I am also sorry for being un-responsive, after my few contributions, I joined the startup to tackle my financial problems.
No need to apologize, this is the live of open source contributors!
I'm closing this since it's for Svelte 4, in which we won't fix edge cases like these anymore. You're welcome to investigate if the issue persists with Svelte 5 (which you find on the main branch).