try to fix reactivity

This commit is contained in:
Richard O'flynn 2020-12-10 19:09:44 +00:00
commit 1c0f7e7856

View file

@ -29,7 +29,7 @@
/** Obtain a reference to the input HTML element */ /** Obtain a reference to the input HTML element */
export let ref = null; export let ref = null;
import { getContext } from "svelte"; import { getContext, onDestroy } from "svelte";
import CheckmarkFilled16 from "carbon-icons-svelte/lib/CheckmarkFilled16"; import CheckmarkFilled16 from "carbon-icons-svelte/lib/CheckmarkFilled16";
const { update, selectedValues, _light } = getContext("SelectableTileGroup"); const { update, selectedValues, _light } = getContext("SelectableTileGroup");
@ -41,6 +41,10 @@
light = light || _light; light = light || _light;
$: selected = $selectedValues.indexOf(value) > -1; $: selected = $selectedValues.indexOf(value) > -1;
onDestroy(() => {
update({ value, selected: false });
});
</script> </script>
<input <input