GeoffCox / sterling-svelte

A Svelte component library built with a minimalist eye and neutral palette.
MIT License
5 stars 1 forks source link

document, window and onMount #1

Open alegtk opened 10 months ago

alegtk commented 10 months ago

Greetings! First of all, I'd like to thank you for sharing this project. I'm a newbie on frontend and was willing to hone some skills. Studying and using someones code is a challenge but in this case it's been worthwhile. I'm working on a Svelte project that's using adapter-static (no SSR). I'd prefer to use python for the backend. I got two build errors when trying to use Select.svelte. The builder (vite build) states ReferenceError: document is not defined on Popover.svelte and later, after dealing with this one, emerges a ReferenceError: window is not defined which I found was on mediaQueries/usingKeyboard.js.

On Popover I just commented the outer call to ensurePortalHost(). Dealt with the later with an onMount handler on Select.svelte. It was more challenging because of the Svelte store and I'm not so sure I did a good job.

Maybe when you have a spare time you can take a look to see if those are really issues.

Well, thanks in advance.

GeoffCox commented 9 months ago

@alegtk Thanks for finding this! I didn't see these issues because I tend to have my apps use an {#if mounted} directive around the layout or page content. I've just published version 1.04 which should fix this class of issues across components and the actions. LMK if this fixed it for you.

alegtk commented 8 months ago

Thank you very much for your effort, @GeoffCox ! I'm very low on time and can't check the fixes right now. As soon as I can I'll do. Check out the kinda of job we could achieve with your package:

2024-02-03-121043_1341x960_scrot

Everybody over here appreciated it. Best regards!