Closed theetrain closed 8 months ago
Original report: https://github.com/carbon-design-system/carbon-components-svelte/discussions/1908#discussioncomment-8698373
Svelte 5 yields a compiler error for <Link> because <div> is an invalid descendent of <p>, which is correct as per W3 spec.
<Link>
<div>
<p>
I recommend we align behaviour with Carbon React:
<a aria-disabled="true">
Reference:
https://github.com/carbon-design-system/carbon-components-svelte/blob/96aef1705cc2812d47a8015a1499a6c6021ced0f/src/Link/Link.svelte#L37-L60
Demo: https://stackblitz.com/edit/sveltejs-kit-template-default-mxnwjf?file=src%2Froutes%2F%2Bpage.svelte
Screenshot:
Yes, I think it makes sense to fix this for <v1 if it's blocking Svelte 5 usage.
Fix was released in v0.83.0.
Original report: https://github.com/carbon-design-system/carbon-components-svelte/discussions/1908#discussioncomment-8698373
Issue
Svelte 5 yields a compiler error for
<Link>
because<div>
is an invalid descendent of<p>
, which is correct as per W3 spec.I recommend we align behaviour with Carbon React:
<a aria-disabled="true">
(⚠️ breaking change since<p>
has different layout behaviour)Reference:
https://github.com/carbon-design-system/carbon-components-svelte/blob/96aef1705cc2812d47a8015a1499a6c6021ced0f/src/Link/Link.svelte#L37-L60
Reproduction
Demo: https://stackblitz.com/edit/sveltejs-kit-template-default-mxnwjf?file=src%2Froutes%2F%2Bpage.svelte
Screenshot: