diff --git a/src/Tile/RadioTile.svelte b/src/Tile/RadioTile.svelte index 2738bc03ee..65b9b5cff5 100644 --- a/src/Tile/RadioTile.svelte +++ b/src/Tile/RadioTile.svelte @@ -20,13 +20,11 @@ /** Set an id for the input element */ export let id = "ccs-" + Math.random().toString(36); - /** Specify a name attribute for the input */ - export let name = ""; - import { getContext } from "svelte"; import CheckmarkFilled16 from "../icons/CheckmarkFilled16.svelte"; - const { add, update, selectedValue } = getContext("TileGroup"); + const { add, update, selectedValue, name, required } = + getContext("TileGroup"); add({ value, checked }); @@ -36,11 +34,12 @@ { if (checked) { selectedValue.set(value); @@ -32,6 +45,8 @@ $: selected = $selectedValue; $: selectedValue.set(selected); + $: inputsName.set(name); + $: inputsRequired.set(required);