Skip to content

<svelte:body> child elements aka the <svelte:body> body #6620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
btakita opened this issue Aug 5, 2021 · 1 comment
Closed

<svelte:body> child elements aka the <svelte:body> body #6620

btakita opened this issue Aug 5, 2021 · 1 comment

Comments

@btakita
Copy link
Contributor

btakita commented Aug 5, 2021

Describe the problem

There are some cases where adding an element as a top level <body> child element is useful.

  • An element, such as a bubble prompt, with position:absolute is often added as a direct child of <body>
  • Integrating another top-level render tree outside of the app

Describe the proposed solution

Support child elements to <svelte:body>

<svelte:body>
<div class="my-bubble">Bubble prompt</div>
</svelte:body>

Alternatives considered

<script>
import { onMount, onDestroy } from 'svelte'
import BubblePrompt from './BubblePrompt.svelte'
let bubble_prompt
onMount(()=>{
  bubble_prompt = new BubblePrompt(document.body, { text: 'Bubble prompt' })
})
onDestroy(()=>{
  bubble_prompt.$destroy()
})
</script>

Importance

nice to have

@btakita btakita changed the title <svelte:body> child elements or the <svelte:body> body <svelte:body> child elements aka the <svelte:body> body Aug 5, 2021
@Conduitry
Copy link
Member

This is essentially a duplicate of #1133, and perhaps also #3105.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants