svelte icon indicating copy to clipboard operation
svelte copied to clipboard

fix: `onDestroy` runs after the component is detached from DOM

Open RaiVaibhav opened this issue 3 years ago • 3 comments

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 test and lint the project with npm run lint

RaiVaibhav avatar Oct 21 '22 18:10 RaiVaibhav

I will close or review this PR after solving this comment. https://github.com/sveltejs/svelte/issues/7888#issuecomment-1336298623

baseballyama avatar Dec 04 '22 01:12 baseballyama

@baseballyama is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Feb 23 '23 12:02 vercel[bot]

@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.

baseballyama avatar Feb 23 '23 12:02 baseballyama

Hey @dummdidumm let me know if I can help here anyhow

RaiVaibhav avatar Apr 07 '24 12:04 RaiVaibhav

I am also sorry for being un-responsive, after my few contributions, I joined the startup to tackle my financial problems.

RaiVaibhav avatar Apr 07 '24 12:04 RaiVaibhav

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).

dummdidumm avatar Apr 08 '24 12:04 dummdidumm