Fix some small svelte warnings

This commit is contained in:
Andrew Kingston 2020-09-17 15:09:06 +01:00
parent 52dde35dee
commit 416e60bd3a
2 changed files with 12 additions and 5 deletions

View File

@ -5,12 +5,19 @@
export let bindings = [] export let bindings = []
export let value export let value
let anchor let anchor
let popover let popover = undefined
let enrichedValue let enrichedValue
let inputProps
// Extract all other props to pass to input component
$: {
let { bindings, ...otherProps } = $$props
inputProps = otherProps
}
</script> </script>
<div class="container" bind:this={anchor}> <div class="container" bind:this={anchor}>
<Input {...$$props} bind:value /> <Input {...inputProps} bind:value />
<button on:click={popover.show}> <button on:click={popover.show}>
<Icon name="edit" /> <Icon name="edit" />
</button> </button>

View File

@ -4,11 +4,11 @@
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
export let value export let value = ""
export let bindings = [] export let bindings = []
export let anchor export let anchor
export let align export let align
export let popover export let popover = null
$: categories = Object.entries(groupBy("category", bindings)) $: categories = Object.entries(groupBy("category", bindings))
@ -46,7 +46,7 @@
<TextArea thin bind:value placeholder="..." /> <TextArea thin bind:value placeholder="..." />
<div class="controls"> <div class="controls">
<a href="#"> <a href="#">
<Body small color="light">Learn more about binding</Body> <Body small>Learn more about binding</Body>
</a> </a>
<Button on:click={popover.hide} primary>Done</Button> <Button on:click={popover.hide} primary>Done</Button>
</div> </div>