make 'for' argument optional in TooltipLabel

The latest svelte-check has revealed we were not passing 'for' in
when we should have been. This is a quick hack to get the tests passing
again, but a better approach that actually makes this accessible again
would be good in the future.
This commit is contained in:
Damien Elmes 2021-09-28 11:25:44 +10:00
parent 04ba24cb54
commit d44b49294b
2 changed files with 7 additions and 4 deletions

View file

@ -5,7 +5,6 @@
<script lang="ts">
import Row from "./Row.svelte";
import Col from "./Col.svelte";
import Label from "./Label.svelte";
import TooltipLabel from "./TooltipLabel.svelte";
import CheckBox from "./CheckBox.svelte";
import RevertButton from "./RevertButton.svelte";
@ -20,7 +19,7 @@
<RevertButton bind:value {defaultValue} />
<CheckBox bind:value
>{#if markdownTooltip}<TooltipLabel {markdownTooltip}><slot /></TooltipLabel
>{:else}<Label><slot /></Label>{/if}</CheckBox
>{:else}<slot />{/if}</CheckBox
>
</Col>
</Row>

View file

@ -10,12 +10,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import Badge from "components/Badge.svelte";
export let markdownTooltip: string;
let forId: string;
let forId: string | undefined = undefined;
export { forId as for };
</script>
<span>
<Label for={forId}><slot /></Label>
{#if forId}
<Label for={forId}><slot /></Label>
{:else}
<slot />
{/if}
<WithTooltip
tooltip={marked(markdownTooltip)}
showDelay={250}