Coder Social home page Coder Social logo

Comments (4)

neilmfrench avatar neilmfrench commented on June 26, 2024 1

Thanks!! Fix works perfectly :)

from svelte-ux.

techniq avatar techniq commented on June 26, 2024

Hey @neilmfrench, thanks for the kind words. I have not tried route based Dialog/Drawer like you are using, but definitely feels like a bug with the Backdrop ordering or rendering of Dialog/Drawer (they are portal’s to the bottom). Could also be SSR related. Could you create a small repo on Stackblitz or similar I could investigate the issue?

from svelte-ux.

neilmfrench avatar neilmfrench commented on June 26, 2024

Thanks @techniq, hopefully this is enough to see it in action: https://stackblitz.com/edit/github-kaggbw-ei6tie?file=src%2Froutes%2Fpage%2F%2Blayout.svelte

If you click through the UI using the navbar by going to Page -> Close button, you should see it working fine. If you go directly to the url .../page/subpage or even refresh with the Dialog open, you'll notice the shading of the drawer is off.

from svelte-ux.

techniq avatar techniq commented on June 26, 2024

Thanks @neilmfrench, that was exactly what I needed (I ended up pulling it locally as it was a little easier to see the URL and test).

So the issue is the order of Backdrop being rendered differently on refresh (should be immediately before the related Drawer/Dialog) and caused by portal'ing these to the bottom of the DOM (body element) to guarantee there isn't inadvertent styles inherited.

Initial Refresh
image image
image image

There are 2 solutions / workarounds. Simply moving the <slot> below the <Drawer> instead of within it will fix the issue.

<Drawer
  bind:open={rightOpen}
  placement="right"
  class="w-[550px]"
  on:outroend={close}
>
  <h2>Some content</h2>
  <div slot="actions">
    <Button on:click={create}>Close</Button>
  </div>
</Drawer>

<!-- move this -->
<slot />

or you can pass portal={false} to either <Drawer> or <Dialog> so one is not portal'd to the bottom. Note, if you do this to the <Dialog> the relative context for the absolutely positioned Dialog will be the Drawer, and thus change the display.

image

from svelte-ux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.