Merge pull request #1213 from gitbutlerapp/link-fix

fix link without href
This commit is contained in:
Nikita Galaiko 2023-09-18 08:39:17 +02:00 committed by GitHub
commit c5dc6785a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,10 +11,12 @@
export let disabled = false;
export let href: string | undefined = undefined;
let element: HTMLAnchorElement | HTMLButtonElement;
let element: HTMLAnchorElement | HTMLButtonElement | undefined;
onMount(() => {
element.ariaLabel = element.innerText?.trim();
if (element) {
element.ariaLabel = element.innerText?.trim();
}
});
$: isExternal = href?.startsWith('http');