UBER-383: fix null/undefined for URI and numbers (#3359)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2023-06-06 16:17:49 +05:00 committed by GitHub
parent f05d817a7c
commit 36b7014327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -19,14 +19,15 @@
export let value: string
export let inline: boolean = false
let divScroll: HTMLElement
$: _value = value ?? ''
</script>
{#if inline}
<a href={value} target="_blank" rel="noreferrer" class="select-text">{value}</a>
<a href={value} target="_blank" rel="noreferrer" class="select-text">{_value}</a>
{:else}
<div class="clear-mins max-w-80">
<ScrollerBar bind:scroller={divScroll}>
<a href={value} target="_blank" rel="noreferrer" class="select-text">{value}</a>
<a href={value} target="_blank" rel="noreferrer" class="select-text">{_value}</a>
</ScrollerBar>
</div>
{/if}

View File

@ -60,7 +60,7 @@
}}
>
<svelte:fragment slot="content">
{#if value !== undefined}
{#if value != null}
<span class="caption-color overflow-label pointer-events-none">{value}</span>
{:else}
<span class="content-dark-color pointer-events-none"><Label label={placeholder} /></span>
@ -68,7 +68,7 @@
</svelte:fragment>
</Button>
{:else if readonly}
{#if value !== undefined}
{#if value != null}
<span class="caption-color overflow-label">{value}</span>
{:else}
<span class="content-dark-color"><Label label={placeholder} /></span>