-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Drawer + Dialog shading on browser reload #403
Comments
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? |
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. |
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
There are 2 solutions / workarounds. Simply moving the <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 |
Thanks!! Fix works perfectly :) |
First of all, thanks for the library - definitely the best Svelte UI library out right now!
I am doing something similar to this, where I have a Drawer open first, then a Dialog inside of it. I am doing this declaratively, e.g. user navigates to /place/1 -> Drawer is open, user navigates to /place/1/dialog -> Drawer and dialog are both open.
When this is done from actions performed on the UI, like clicking the button that navigates to /place/1 and then clicking another button to navigate to /place/1/dialog, this all works perfectly.
My issue is when I go directly to /place/1/dialog, for example by opening it directly in a new browser tab, the shading on the Drawer is not present. Hopefully the following pictures illustrate that:
Correct - through interactions on the UI
![drawer-correct](https://private-user-images.githubusercontent.com/9321923/341594673-8338867f-fa0f-407d-959b-4612c5cce768.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI5NDgyMDAsIm5iZiI6MTcyMjk0NzkwMCwicGF0aCI6Ii85MzIxOTIzLzM0MTU5NDY3My04MzM4ODY3Zi1mYTBmLTQwN2QtOTU5Yi00NjEyYzVjY2U3NjguUE5HP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MDZUMTIzODIwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDg0Y2FhOWM0NTE4MzY3M2M1MWY0NzMyODMzZWNiOTMyNmI3NGRkMjRiOGQ5OGQxNTZkMDM4NjM4MTQ4ZTI5MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.huDIRC_-zKOhwGC4BLdlvbOVSEkCQRynm_M9tZXbSk4)
No shading - through going directly to the URL
![drawer-incorrect](https://private-user-images.githubusercontent.com/9321923/341594748-c5af2877-eadb-48fb-83ad-674786bbf497.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI5NDgyMDAsIm5iZiI6MTcyMjk0NzkwMCwicGF0aCI6Ii85MzIxOTIzLzM0MTU5NDc0OC1jNWFmMjg3Ny1lYWRiLTQ4ZmItODNhZC02NzQ3ODZiYmY0OTcuUE5HP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MDZUMTIzODIwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmU2NjEwZjZhMTNkZGU2NjAwNmU5ZjRlMzc1NTdjYzIyZTIxNDUyZDgwZjVjMzY4Yzc0NWY4OTU3OGU1YTQ1NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.OeMVVU15_AWMd_kguTYlKgPzi04vTXQFA5Ny_lKTFPk)
I could probably hack around this in CSS, but I wanted to see if this is a potential bug first.
The text was updated successfully, but these errors were encountered: