fix(link)!: do not render p for disabled link

Closes #1924

Svelte 5 will not compile if `div` is nested inside `p` element. Refactor Link to render an `a` instead of `p` when disabled.
This commit is contained in:
metonym 2024-03-06 19:07:45 -08:00 committed by Enrico Sacchetti
commit 8bffc17d65
4 changed files with 24 additions and 21 deletions

View file

@ -1,7 +1,7 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["a"] & SvelteHTMLElements["p"];
type RestProps = SvelteHTMLElements["a"];
export interface LinkProps extends RestProps {
/**
@ -45,7 +45,7 @@ export interface LinkProps extends RestProps {
* Obtain a reference to the top-level HTML element
* @default null
*/
ref?: null | HTMLAnchorElement | HTMLParagraphElement;
ref?: null | HTMLAnchorElement;
[key: `data-${string}`]: any;
}