skeleton icon indicating copy to clipboard operation
skeleton copied to clipboard

Empty style tag added to head on menu open/close

Open thomasbjespersen opened this issue 3 years ago • 5 comments

When opening or closing a menu, an empty style tag is added to the head.

STR:

  1. Open Dev Tools and select Elements (or click on page-> Inspect)
  2. Go to the Menu docs and open/close a menu
  3. Inspect the head in dev tools

Screen Shot 2022-08-11 at 7 39 13 PM

thomasbjespersen avatar Aug 12 '22 01:08 thomasbjespersen

Please hold off on this one until https://github.com/Brain-Bones/skeleton/issues/41 is completed and merged.

thomasbjespersen avatar Aug 12 '22 02:08 thomasbjespersen

I have seen this same behavior for things like the lightswitch and accordion, but Not sure how many components overlap under the hood

luke-hagar-sp avatar Aug 17 '22 14:08 luke-hagar-sp

Good to know it's happening with the accordion too. VERY strange bug, but two things of note:

  • The next update contains a total rebuild of the accordion component. It now utilizes detail/summary tags. So it may no longer cause the issue since it's less JS heavy.
  • I'm not saying the LightSwitch is without issue. Frankly the code is bad (I know, I wrote it heh). But it may be worth checking if the issue persists in the new SvelteKit versions. Could have been a Svelte/SvelteKit bug. But either way a refactor and improvement to that component is overdue.

FYI I'll be implementing a PR for updating to the next.405+ version of SvelteKit today, so I'll try remember to check this as I test!

endigo9740 avatar Aug 17 '22 16:08 endigo9740

Roger, I will note my project is Current with SvelteKit.

luke-hagar-sp avatar Aug 17 '22 16:08 luke-hagar-sp

FYI I've confirmed the following:

  • I can replicate the head/style element updates for the live/production version of Skeleton (v0.30.7)
  • I cannot reproduce the issues in the most current dev branch, which means the accordion issues are resolved.

Given this, I'll turn my attention to the Menu and LightSwitch components.

endigo9740 avatar Aug 17 '22 19:08 endigo9740

I was under the impression the LightSwitch was at fault here, so I've opted to refactor and redesign this a bit. It now looks and operates a lot like the versions on these sites:

  • https://vitejs.dev/
  • https://vitest.dev/

Screen Shot 2022-08-17 at 6 08 18 PM

Screen Shot 2022-08-17 at 6 08 25 PM

Unfortunately this has not solved the problem with the HTML head style blocks being duplicated, however this now only occurs when interacting with Menu components. I'll turn my attention to to the Menu components tomorrow.

endigo9740 avatar Aug 17 '22 23:08 endigo9740

Keeping this open to address the Menu updates mentioned in the comment above.

endigo9740 avatar Aug 17 '22 23:08 endigo9740

Finally came across this and identified it's the transition directive that's causing this to occur. We use transition on several components, including Menus, Alerts, etc.

https://github.com/sveltejs/svelte/issues/4801

Gonna mark this CLOSED as I don't believe it's an issue we can fix on our end. I'd suggest we report it to Svelte if we can identify any negative impact from this.

endigo9740 avatar Aug 18 '22 00:08 endigo9740