Replies: 1 comment
-
Sorry, just saw this and was able to reproduce the issue when hitting the back button with bigger-picture open. I think the easiest fix is to return an object with a destroy method from your action which runs when the node is destroyed. In that destroy method we can destroy the bigger-picture instance. TS yells at you about export async function biggerPicture(node: HTMLElement) {
...
return {
destroy() {
// @ts-ignore
bp?.$destroy()
// @ts-ignore
bp = undefined
},
}
} Let me know if that doesn't work, I have a few other ideas. Also, you are a developer now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there folks, I was wondering, how could I make so that if you navigate back while BP is open, that bp closes? As it is, it seems like sometimes it does close after a short delay, other times it doesn't, and some other times it doesn't && navigates to the next item. Now I'm not a developer, I'm actually an artist, so there's a good chance that closing is default behavior and I've somehow screwed it up or that it would be easy to implement and I just don't know how? I'm just feeling my way around in this. Anyway here's how I have the whole thing setup:
BiggerPicture works fine, I'm just not sure how to proceed here. I looked into sveltekit docs and found onNavigate and $navigation store which help tell when I'm navigating away and I guessed i could then call bp.close(). But where would I do that? I can access onNavigate etc. on the ts file where I load BP.
Of course I really don't know what I'm doing here so it might be better to ignore all above and just let me know, if you can help, can I somehow do this?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions