Closed vkurko closed 1 year ago
@LeonHeidelbach This issue should be fixed in v2.3.1. Please check.
@vkurko I can confirm that the error now no longer occurs. However, with the updated version the same issue as in v.2.2.0
arises. On the initial page load everything renders correctly but after even a hotreload of the page when using vite dev
, on changing an unrelated thing like adding a random comment, the calendar classes all seem to dissapear. For some reason almost all fields that hold the calendar's class lists are now undefined. I am still using only this function to alter the theme:
theme: (theme: CalendarThemeOptions) => {
theme.button = `ec-button dark:!bg-gray-800 dark:!text-white dark:hover:!bg-gray-700
hover:cursor-pointer`;
theme.icon = 'ec-icon dark:after:!border-white';
theme.today = 'ec-today dark:!bg-gray-600 dark:!text-white';
return theme;
},
As you can see on the screenshot below, weirdly enough a couple of classes seem to still be available. Note, that even though I change the theme.today
value in the function above, the only class on the today
node is ec-today
. Something that does not contain most of the needed fields seems to override the theme object when looping through the object keys.
Oh that SvelteKit! :upside_down_face: I'll look into this.
@LeonHeidelbach Ok, there is v2.3.2. Lots of changes in hopes of fixing the problem. Please check.
@vkurko Yes, this now finally does the trick. Thank you for your efforts! :+1:
Great! 😄
@vkurko This error only occurs if I set a function (i.e. the one from my previous comment) to the
theme
variable and not when I set a static dictionary. So there is no way that I am passing the incorrect object. ;) Theweekdays
field does get properly set in the theme variable that is passed to the function and so does everything else (compared it to the default by console logging). From the debug output I can see that the error occurs in the module@event-calendar/day-grid/src/Header.svelte
line 11, right here:Could it be that you are not properly unsubscribing from a store on destroying a component? I am just handwaving here, since I am not familiar with your code base but the issue is definitely related to stores, funnily enough only if
theme
is set to a function though.Originally posted by @LeonHeidelbach in https://github.com/vkurko/calendar/issues/155#issuecomment-1695431053